Kahuki Webmaster Forum and Discussion Community  

Go Back   Kahuki Webmaster Forum and Discussion Community > Website Development & Management > Programming > PHP



Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-23-2007, 11:32 AM
Rookie
 
Join Date: Dec 2007
Posts: 43
jgrant is on a distinguished road
Uploading Files using PHP

Hey, I've found a few tutorials on this, but none of them really made any sense. Could someone please explain to me how you upload files using php?

Reply With Quote
  #2 (permalink)  
Old 07-14-2008, 06:34 AM
Rookie
 
Join Date: Jul 2008
Posts: 41
Sakari is on a distinguished road
you should try it.......
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>


Reply With Quote
  #3 (permalink)  
Old 07-22-2008, 09:56 AM
Rookie
 
Join Date: Jul 2008
Posts: 2
madhuri_vats@yahoo.com is on a distinguished road
upload file in php

you can upload file using

move_uploaded_file function

Web Design Company | Asp.Net Programmers | web designers Delhi

Reply With Quote
  #4 (permalink)  
Old 07-23-2008, 10:14 AM
Rookie
 
Join Date: Jul 2008
Posts: 10
Dachao is on a distinguished road
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];

$filePath = $uploadDir . $fileName;

$result = move_uploaded_file($tmpName, $filePath);
if (!$result) {
echo "Error uploading file";
exit;
}
this coding are require at top of php program.

__________________
web design
Free Templates

Reply With Quote
  #5 (permalink)  
Old 07-31-2008, 10:57 AM
Rookie
 
Join Date: Jul 2008
Posts: 41
Sakari is on a distinguished road
Quote:
Originally Posted by Dachao View Post
$fileName = $_FILES['userfile']['name'];
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];

$filePath = $uploadDir . $fileName;

$result = move_uploaded_file($tmpName, $filePath);
if (!$result) {
echo "Error uploading file";
exit;
}
this coding are require at top of php program.
dacheo , thanks I have try this. I running correct and perfect.

______________________________________
web design company
free templates

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:14 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0