Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   PHP / mySQL (http://siteownersforums.com/forumdisplay.php?f=10)
-   -   How can we upload files in PHP? (http://siteownersforums.com/showthread.php?t=65422)

noahwilson 06-08-2013 02:09 AM

How can we upload files in PHP?
 
Hi friends,
How can we upload files in PHP? i want that user can be post own resume file through forum. please tell me php script for that.
thanks for any reply.

Ranjan123 10-16-2013 08:56 AM

PHP Code:


Posting form script is
Resume 
<input type="file" name="resume" size="25" />

and 
php code is 

if($_FILES['resume']['name']) 


Luca tall 10-21-2013 06:21 AM

$uploads_dir = '/uploads';
foreach ($_FILES["pictures"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["pictures"]["tmp_name"][$key];
$name = $_FILES["pictures"]["name"][$key];
move_uploaded_file($tmp_name, "$uploads_dir/$name");
}
}
?>

kashifalijugnoo 10-23-2013 05:36 AM

html code for upload and submit button
enctype="multipart/form-data">





//////// php code for upload file temporarily//////////////////
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "
";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "
";
echo "Type: " . $_FILES["file"]["type"] . "
";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB
";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
//FOR PERMANENT STORAGE YOU HAVE TO MOVE FILE FROM TEMP TO OTHER FOLDER

mridul 11-05-2013 11:34 PM




enctype="multipart/form-data">









All times are GMT -7. The time now is 11:02 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.