Go here: http://www.tizag.com/phpT/fileupload.php

Under the heading "php - file upload: uploader.php" there are these sentences:-

----$_FILES['uploadedfile']['name'] - name contains the original path of the user uploaded file.
----$_FILES['uploadedfile']['tmp_name'] - tmp_name contains the path to the temporary file that resides on the       server. The file should exist on the server in a temporary directory with a temporary name.

I don't understand these two sentences. Could someone explain?

Warm regards,
Cadence

when u upload any file, from your computer say c:\abcfolder\myfile.doc
so myfile.doc will be saved in variable file['name']

when you submit file to upload, this file is copied to temp folder on server say /tmp/xyzzfile

this is stored in file['tmp_name']

u can move this file from temp folder to folder of your choice on ur server by using

move_uploaded_file(file[tmp_name],'/server/myuplodfolder/myfile.doc');

I still did not get it.

so myfile.doc will be saved in variable file['name']

What is this

$_FILE['name']

? Not mentioned on the website.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.