Jump to content

Recommended Posts

// Now we should move the uploaded file to it's temporary directory
message("Temporary directory: temp/$tempfolder/".$_FILES['uploadedfile']['name']);
if(copy($_FILES['uploadedfile']['tmp_name'], "temp/$tempfolder/".$_FILES['uploadedfile']['name'])){
  success("Uploaded file moved to temporary directory");
} else {
  cleanup("Uploaded file could not be moved to temporary directory");
}

$tempfolder - A unique 5 digit folder name

message(); - Sends output as a message (applies certain formatting etc)

cleanup(); - There has been an error so this function displays the error applying formatting. It also deletes all the temporary files and so on.

This part of the script is designed to move the uploaded file (a ZIP) to a temporary location that I can access and use the ImageMagick library on.

 

The error displayed is

Uploaded file could not be moved to temporary directory

 

I'm not very good at PHP and I followed the tutorial here

 

Please help me

- Sam

Link to comment
https://forums.phpfreaks.com/topic/50963-uploader-errors/
Share on other sites

Ok, so I've gotten a bit further with sorting out my problem. When I check the $_FILES variable using print_r() I get this:

Array ( [uploadedfile] => Array ( [name] => shinji.zip [type] => [tmp_name] => [error] => 2 [size] => 0 ) )

My file can't be moved because [tmp_name] isn't set. And I havn't got a clue why this is...

 

Can someone please shed some light on this?

- Sam

Link to comment
https://forums.phpfreaks.com/topic/50963-uploader-errors/#findComment-250759
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.