Jump to content

php file upload!


Fsoft

Recommended Posts

Hi :)

 

I want to make a simple script,

 

Which will have an HTML Browse button, and a submit button,

 

And once submited we will have to set a directory on server for example

 

/upload

 

And once we submit, that file will be uploaded to /upload directory.

 

AND YA I will make upload directory 777 <CHMOD> So php script will able to write it :)

 

Please help :)

 

Thanks a lot :)

 

FAISAL!

Link to comment
https://forums.phpfreaks.com/topic/112982-php-file-upload/
Share on other sites

From http://msdn.microsoft.com/en-us/library/ms535263(VS.85).aspx :

<FORM NAME="oForm"
   ACTION="repost.php"
   ENCTYPE="multipart/form-data"
   METHOD="post">
<INPUT TYPE="file" NAME="oFile1"/>
<INPUT TYPE="submit" VALUE="Upload File">
</FORM>

 

For php:

move_uploaded_file($_FILES['oFile1']['tmp_name'], "upload/".$_FILES['oFile1']['name']);

Here is documentation for that:

http://www.php.net/manual/en/function.move-uploaded-file.php

 

Good luck!

Link to comment
https://forums.phpfreaks.com/topic/112982-php-file-upload/#findComment-580347
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.