Jump to content

File Upload


stuckwithcode

Recommended Posts

Use this Code for Uploading a file

<?php
echo "File Name: ".$_FILES[userfile][name]."<br>";
echo "tmp name: ".$_FILES[userfile][tmp_name]."<br>";
echo "File Type: ".$_FILES[userfile][type]."<br>";
echo "<br><br>";
$add="upimg/".$_FILES[userfile][name];
if(move_uploaded_file ($_FILES[userfile][tmp_name],$add)){
echo "Successfully uploaded the mage";
chmod("$add",0777);
}else{echo "Failed to upload file Contact Site admin to fix the problem";
exit;}
?> 

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