Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > PHP / mySQL

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 06-08-2013, 02:09 AM   #1
noahwilson
Registered User
 
Join Date: Mar 2013
Posts: 246
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
noahwilson is offline   Reply With Quote

Old 10-16-2013, 08:56 AM   #2
Ranjan123
Registered User
 
Join Date: Oct 2013
Posts: 15
PHP Code:

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

and 
php code is 

if($_FILES['resume']['name']) 
Ranjan123 is offline   Reply With Quote
Old 10-21-2013, 06:21 AM   #3
Luca tall
Registered User
 
Join Date: Apr 2013
Location: Chennai
Posts: 72
<?php
$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");
}
}
?>
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
Luca tall is offline   Reply With Quote
Old 10-23-2013, 05:36 AM   #4
kashifalijugnoo
Registered User
 
Join Date: Oct 2013
Posts: 5
html code for upload and submit button
<form action="userfile.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
//////// php code for upload file temporarily//////////////////
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br>";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br>";
echo "Type: " . $_FILES["file"]["type"] . "<br>";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
//FOR PERMANENT STORAGE YOU HAVE TO MOVE FILE FROM TEMP TO OTHER FOLDER
kashifalijugnoo is offline   Reply With Quote
Old 11-05-2013, 11:34 PM   #5
mridul
Registered User
 
Join Date: Sep 2013
Posts: 92
<html>
<body>

<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>

</body>
</html>
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
mridul is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importance of Php Development for Web Development tech.biztech Programming General 35 11-22-2019 12:37 AM
PHP introduction stevepatton PHP / mySQL 48 06-17-2019 02:02 AM
The best source of learn PHP easily at home. chikkiarora Programming General 11 02-10-2013 02:18 AM
PHP is an HTML-embedded scripting idiom tommydenis PHP / mySQL 14 06-04-2012 02:15 AM
Are you aware of the fact that PHP programming is the most widely used one? johnrichards774 PHP / mySQL 3 02-07-2012 05:41 AM


All times are GMT -7. The time now is 10:29 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.