Jump to content

help with uploading to server


lifeson2112

Recommended Posts

Hello, I have been trying to make a page to upload files to my server, but I can't seem to get it to work.

 

<html>
<form name="submit_file" action="getFile.php" method="post" encytype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="2000">
<input type ="file" name="tab_file" id="tab_file"/>
<input type="submit" value="submit file" />
</form>
</html>

 

<?php
if (is_uploaded_file($HTTP_POST_FILES['tab_file']['tmp_name']))
{
   echo "File was uploaded to temporary directory.\n";
} 

else 
{
   echo "This is not working!!!!!!\n";
//line 21 below   
if(unlink($HTTP_POST_FILES['tab_file']['tmp_name']))
   	echo"deleted crappy file";
}
?>

 

Also, ever since I put the "unlink" function in there it gives me this error - Warning:  unlink() [function.unlink]: Permission denied in C:\Program Files\xampp\htdocs\getFile.php on line 21

 

From this, I'm pretty sure my server isn't even storing the file in a temporary directory or doesn't know where to get it. ?

Any help on this at all would be much appreciated.

 

Link to comment
https://forums.phpfreaks.com/topic/42542-help-with-uploading-to-server/
Share on other sites

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.