Jump to content


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


moving non-uploaded files

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.

Share this post

Link to post
Share on other sites


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.