PDA

View Full Version : Sending Photos by Image Uploading


Rhees
11-06-2007, 01:03 PM
Hello,

I am making a webpage and I would like to have an image uploading feature with the click of a browse file and upload button.

Does anybody know how this is done? I heard .asp or .php scripting can do this. Is this difficult? Can .asp be supported by any server?

Been searching for scripts online and looking at how tos but can't figure it out.

Thanks,

kakkoii_daw
11-06-2007, 01:13 PM
hello rhees,
here's a simple php file upload script :D


<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>



// Where the file is going to be placed
$target_path = "uploads/"; //<--kelangan may write access dito

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$_FILES['uploadedfile']['tmp_name'];


full tutorial here... (http://www.tizag.com/phpT/fileupload.php) :D

Rhees
11-06-2007, 01:27 PM
hello rhees,
here's a simple file upload php script :D


<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>



// Where the file is going to be placed
$target_path = "uploads/"; //<--kelangan may write access dito

/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
$_FILES['uploadedfile']['tmp_name'];


full tutorial here... (http://www.tizag.com/phpT/fileupload.php) :D

WOW ! Kakkoii naman ito! Maraming salamat! Sige try ko. Ano naman ba yung write access? Kung sakin naman yung HP, di may write access ako, ganun ba yun?

May limit ba yung file size na puede ma-upload? Di ba bumababa yung quality ng image file?

kakkoii_daw
11-06-2007, 01:35 PM
^kung windows ang server mo, no need to configure, pero kung linux, u need to "chmod 755 uploads" directory para makapagupload ka. pwede mo ren gawin ito with your favorite ftp client if yours is on a webhosting service. example filezilla... :D

http://johnbokma.com/mexit/2007/01/05/chmod-755-via-filezilla-change-file-attributes.png

pwede mo iset ang limit.. di bababa ang quality kaya lang for images beyond the specified di nya yun tatanggapin... :D