Jump to content

moving non-uploaded files


arianhojat

Recommended Posts

I read in php manual that the move_uploaded_file function...
[quote]"checks to ensure that the file designated by filename is a valid upload file (meaning that it was uploaded via PHP's HTTP POST upload mechanism)."[/quote]

Now I was wondering how to move a non-uploaded file as there is no move() function in php, I assume cause of security...
What I would like to do is move a file in FILES array to a temp folder on upload. Then while doing some other code, if I figure out it needs to be moved again, move_uploaded_file doesnt seem to want to move it (since i assume its not a uploadedfile in /temp folder anymore).

Anyone know a way past this? or should i just not move the file until i do all those 'code checks'.

I am probably going to do all my validation 1st, before uploading the file now... but I was thinking it would still be useful for move a non-uploaded file even though its a php security restriction probably? Because when a user uploads a file, I would like to move the uploaded file, but also move the orig file (if it exists), to an archive directory and call it, filename[0].fileExt .
I have seen php code that claims to do something like this, although I am not sure how they can move non-uploaded files.
Link to comment
Share on other sites

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.