Jump to content

[SOLVED] moving file problem


shadiadiph

Recommended Posts

Hi I am having a problem moving a file using

 

move_uploaded_file($fileatt, "../secure/admin/clients/$username"); 

 

the file path is outside the directory the file is in so I am using ../ as you usually would the file path exists but it keeps telling me it doesn't.??

 

the error is

Warning: move_uploaded_file(../secure/admin/clients/johnny99/) [function.move-uploaded-file]: failed to open stream: Is a directory in /home

Link to comment
https://forums.phpfreaks.com/topic/145719-solved-moving-file-problem/
Share on other sites

the file path is outside the directory the file is in so I am using

 

The directory the uploaded file is in, or the directory the script is running in? The destination directory must be relative to the directory you're running the script from, not where the file is saved.

 

Adam

the script is running in a directory called submit

 

my diectories in the main htm folder are

 

images

submit

secure

 

script is running in the submit directory previously in this script I have already used mkdir("../secure/admin/clients/$username", 0700);

 

I checked it has already made the directory ../secure/admin/clients/johnny99

 

etc

sorry noticed one error I am now using

 

move_uploaded_file($fileatt, "../secure/admin/clients/$username/$fileatt_name"); 

 

and am still getting a similar error

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phplVoz1r' to '../secure/admin/clients/johnny99/Forest Flowers.jpg'

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.