Jump to content

File upload to the server idr using PHP


Recommended Posts

Hi,

Friends,

 

Can anyone give me source code/idea on "how to upload file from client computer to my server by using a php script

 

assume that folder on server to store the uploaded files :- D:\users\uploaded_files

 

Thank you

Rittwick Banerjee

No need to bump the thread after 1 minute. Anyway, just make a form that looks something like:

 

<form enctype="multipart/form-data" action="upload.php" method="post">
Upload File: <input name="file" type="file" /><br />
<input type="submit" name="submitfile" />
</form[code]

Note the enctype - it's very important. Once the user submits the form the file gets uploaded to a temporary place on the server. You can access it with $_FILES['file']['tmp_name']. You need to move it to another location on your server (eg. D:\users\uploaded_files) using the move_uploaded_file() function.

[/code]

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.