Jump to content

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'

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.