|
|
 |
Sign in...
Submit your site
|
Uploading a File
This code is commonly used when there is a need of uploading small and medium files onto a server.
It will be done in 2 steps.
- Create an HTML form to pick up the name;
- Upload the file and move it to the right directory
You should follow these steps in order to get your script working:
- Fill in details about the path for the file (input the path of the file inside the $pathfile variable;
- Make sure you have the privileges to move and write a file into the directory (use of chmod function).
The different Files
- The upload.html file:
It contains the html form.
Simply copy this to a file and name it upload.html.
- The uploadfile.php file:
This file is used to handle the file on the server side.
Now you should have uploaded the 2 files onto your server inside the same directory.
Run it and use the code wherever you wish.
Note: for larger files, you may use the FTP protocol or develop some applets (Java, ActiveX...).
Comments
No comment yet, write the first now here or onto our webmaster forum
|
Categories
|