leiaah 0 Report post Posted May 12, 2005 Can anyone help me out again? Thanks.I need a code that has a basic form that allows you to browse for an image file and when the submit button is clicked, that image gets uploaded to a folder in my site (e.g. images/*.jpg) Share this post Link to post Share on other sites
mizako 0 Report post Posted May 12, 2005 I was looking for the same functionality. If someone knows how can i code to upload files after browsing and also give the functionality to upload zip files und unzip them once they are uploaded. I would be really grateful!!!! Share this post Link to post Share on other sites
HmmZ 0 Report post Posted May 12, 2005 also here, GOOGLE is your friend... Search term: image upload php code http://forums.xisto.com/no_longer_exists/ http://forums.xisto.com/no_longer_exists/ http://forums.xisto.com/no_longer_exists/ http://forums.xisto.com/no_longer_exists/ Share this post Link to post Share on other sites
icey 0 Report post Posted May 17, 2005 yes google is still useful Share this post Link to post Share on other sites
leiaah 0 Report post Posted May 17, 2005 Great. I'm toying with the code alrady. Thanks! Share this post Link to post Share on other sites
alexia 0 Report post Posted May 21, 2005 Oh i think you can use php script on your cpanel or search in hotscripts.com or many php scripts web site but i find to u one uploader CMS i think find it in scriptsbalabala.com its very old <?$extlimit = "yes"; //Do you want to limit the extensions of files uploaded$limitedext = array(".gif",".jpg",".png",".jpeg"); //Extensions you want files uploaded limited to.$sizelimit = "no"; //Do you want a size limit, yes or no?$sizebytes = "200000"; //size limit in bytes$dl = "http://http://ww11.zachwhite.com/demo/up-down&%2334/?gtnjs=1;; //url where files are uploaded$absolute_path = "/home/zachwhit/public_html/demo/up-down"; //Absolute path to where files are uploaded$websiteurl = "zachwhite.com;; //Url to you website$websitename = "Zach White Network";switch($action) {default:echo"<html><head><title>Upload Or Download</title></head><body><a href=$PHP_SELF?action=upload>Upload File</a> <a href=$PHP_SELF?action=download>Download File</a> <a href=$websiteurl>Return to $websitename</a><br><br></body></html>";break;case "download":echo "<html><head><title>File Download</title></head><body><a href=$PHP_SELF?action=upload>Upload File</a> <a href=$websiteurl>Return to $websitename</a>";$list = "<table width=700 border=1 bordercolor=#000000 style=\"border-collapse: collapse\">";$list .= "<tr><td width=700><center><b>Click To Download</b></center></td></tr>";$dir = opendir($absolute_path);while($file = readdir($dir)) {if (($file != "..") and ($file != ".")) {//Download files with spaces fix by Kokesh$list .= "<tr><td width=700><a href='$dl/$file'>$file</a></center></td></tr>";}}$list .= "</table>";echo $list;echo"<br><br>Powered by <a href=http://http://ww11.zachwhite.com//?gtnjs=1 Uploader Downloader</a></body></html>";break;case "upload":echo"<html><head><title>File Upload</title></head><body><form method=POST action=$PHP_SELF?action=doupload enctype=multipart/form-data><p>File to upload:<br><input type=file name=file size=30><p><button name=submit type=submit>Upload</button></form><br><br>Powered by <a href=http://http://ww11.zachwhite.com//?gtnjs=1 Uploader Downloader</a></body></html>";break;//File Uploadcase "doupload":$dir = "dir";if ($file != "") {if (file_exists("$absolute_path/$file_name")) {die("File already exists");}if (($sizelimit == "yes") && ($file_size > $sizebytes)) {die("File is to big. It must be $sizebytes bytes or less.");}$ext = strrchr($file_name,'.');if (($extlimit == "yes") && (!in_array($ext,$limitedext))) {die("The file you are uploading doesn't have the correct extension.");}@copy($file, "$absolute_path/$file_name") or die("The file you are trying to upload couldn't be copied to the server");} else {die("Must select file to upload");}echo "<html><head><title>File Uploaded</title></head><body>";echo $file_name." was uploaded";echo "<br><a href=$PHP_SELF?action=upload>Upload Another File</a><a href=$PHP_SELF?action=download> Download File</a><a href=$websiteurl> Return to $websitename</a><br><br>Powered by <a href=http://http://ww11.zachwhite.com//?gtnjs=1 Uploader Downloader</a></body></html>";break;}?> Save this code on one php file and save name is updown change your folder permission to 777 If you want to upload or download your file form your folder on your host Share this post Link to post Share on other sites
Bayuugan 0 Report post Posted June 8, 2008 google is very very useful Share this post Link to post Share on other sites