Jump to content

move_uploaded_file


abdelelbouhy

Recommended Posts

hello guysi'm trying to upload file then move it to the desktop the uploading is done i've checked the temprary file in windows but the file didn't move i think the problem is with the path name here is the code<?php if(is_uploaded_file($_FILES['toProcess']['tmp_name'])){ echo 'success'; } move_uploaded_file($_FILES['toProcess']['tmp_name'],"desktop"); ?> if someone help me and tell me some example of the path name like if i want to put in the desktop or in the root directorythanx

Link to comment
Share on other sites

I have this in one site I've built, although I haven't included any of the checks you must be for file uploads. (such as checking the file is the right type and size and not something that can cause a few hiccups on the site).

$file_name = $_FILES['uploadfile']['name'];$file_temp = $_FILES['uploadfile']['tmp_name'];$uploads_dir = 'movedfiles';move_uploaded_file($file_temp, "$uploads_dir/$file_name");

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...