This post has been edited by BarNunBoi: 08 January 2013 - 02:23 PM
6 Replies - 180 Views - Last Post: 09 January 2013 - 09:36 AM
#1
Error:Move Uploaded File Failed To Open Stream: Is a Directory
Posted 08 January 2013 - 02:21 PM
I am trying to move and uploaded file from the temp folder and I keep getting Failed To Open Stream: Is a Directory. I have never seen this error before. Can anyone tell me why I am getting this error message? I have checked my permissions, and I do have permission to write to the folder. My permissions are 777. Any ideas? Thanks In Advance!
Replies To: Error:Move Uploaded File Failed To Open Stream: Is a Directory
#2
Re: Error:Move Uploaded File Failed To Open Stream: Is a Directory
Posted 08 January 2013 - 02:26 PM
Also why is my directory showing as follows : app/webroot//spreadsheet
Notice the 2 forward slashes
Notice the 2 forward slashes
This post has been edited by BarNunBoi: 08 January 2013 - 08:23 PM
#3
Re: Error:Move Uploaded File Failed To Open Stream: Is a Directory
Posted 08 January 2013 - 03:06 PM
where is your code?
#4
Re: Error:Move Uploaded File Failed To Open Stream: Is a Directory
Posted 08 January 2013 - 03:52 PM
public function saveSpreadsheet($uploadedFile) {
if(!empty($uploadedFile) && !empty($uploadedFile['tmp_name'])) {
if($uploadedFile['error'] == UPLOAD_ERR_OK) {
$pulledData = $this->extract($uploadedFile['tmp_name']);
$filePath = WWW_ROOT . DS . 'spreadsheet';
if(!empty($pulledData)){
$pulledData = $this->Declination->ContactType->setSpreadsheetContactTypeIds($pulledData);
if(!empty($pulledData[$this->alias])) {
$this->save($pulledData[$this->alias]);
unset($pulledData[$this->alias]);
$coverageId = $this->id;
$pulledData = $this->setSpreadsheetCoverageIds($pulledData, $coverageId);
$pulledData = $this->CoverageInsured->setSpreadsheetCoverageInsuredIds($pulledData);
//$pulledData = $this->Policy->Location->setupSpreadsheetPolicyLocation($pulledData, $coverageId);
}
$this->CoverageInsured->save($pulledData['CoverageInsured']);
$this->Declination->saveAll($pulledData['Declination']);
$this->savePolicyData($pulledData);
move_uploaded_file($uploadedFile['tmp_name'], $filePath);
//$this->Policy->Location->saveAll($pulledData['Location']);
//$this->Policy->Company->saveAll($pulledData['Policy']);
return $coverageId;
}
}
}
return false;
}
#5
Re: Error:Move Uploaded File Failed To Open Stream: Is a Directory
Posted 09 January 2013 - 08:10 AM
In addition to what I have already posted...when I go to the webroot folder and check write permissions for Group and World and run my script I get a Unknown Server Error. Hope this helps. With that said, my permissions for the spreadsheet folder is 777.
#6
Re: Error:Move Uploaded File Failed To Open Stream: Is a Directory
Posted 09 January 2013 - 08:52 AM
Ok here what I've got so far......I changed
to
and the file saved but it didn't save inside the spreadsheet folder..it saved in the webroot folder. So I am no longer getting an error message. I am just having trouble saving to the right folder. With that said my file structure is as follows:
app/webroot/spreadsheet
How would I write my file path so I can drill down into the spreadsheet folder?
$filePath = WWW_ROOT . DS . 'spreadsheet';
to
$filePath = WWW_ROOT . DS . $uploadedFile['name']';
and the file saved but it didn't save inside the spreadsheet folder..it saved in the webroot folder. So I am no longer getting an error message. I am just having trouble saving to the right folder. With that said my file structure is as follows:
app/webroot/spreadsheet
How would I write my file path so I can drill down into the spreadsheet folder?
This post has been edited by BarNunBoi: 09 January 2013 - 09:31 AM
#7
Re: Error:Move Uploaded File Failed To Open Stream: Is a Directory
Posted 09 January 2013 - 09:36 AM
Never mind!! I got it!! This is what I ended up with
Problem solved!
$filePath = WWW_ROOT.'/spreadsheet/' . DS . $uploadedFile['name'] ;
Problem solved!
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|