| | 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) |
|
|
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!!!!
also here, GOOGLE is your friend...
Search term: image upload php code http://codewalkers.com/seecode/85.html http://php.resourceindex.com/Complete_Scri...ile_Management/ http://www.fuzzywebmaster.com/results/php-...ipt-upload.html http://www.stadtaus.com/en/php_scripts/gallery_script/
Great. I'm toying with the code alrady. Thanks!
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 CODE <? $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://www.zachwhite.com/demo/up-down"; //url where files are uploaded $absolute_path = "/home/zachwhit/public_html/demo/up-down"; //Absolute path to where files are uploaded $websiteurl = "http://www.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> Powered by <a href=http://www.zachwhite.com/>PHP Uploader Downloader</a> </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://www.zachwhite.com/>PHP 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://www.zachwhite.com/>PHP Uploader Downloader</a> </body> </html>"; break; //File Upload case "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://www.zachwhite.com/>PHP 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
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 CODE <? $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://www.zachwhite.com/demo/up-down"; //url where files are uploaded $absolute_path = "/home/zachwhit/public_html/demo/up-down"; //Absolute path to where files are uploaded $websiteurl = "http://www.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> Powered by <a href=http://www.zachwhite.com/>PHP Uploader Downloader</a> </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://www.zachwhite.com/>PHP 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://www.zachwhite.com/>PHP Uploader Downloader</a> </body> </html>"; break; //File Upload case "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://www.zachwhite.com/>PHP 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 google is very very useful
Similar Topics
Keywords : upload, pics, php
?!? (11) I need the image upload script which automatically resized the image by specified size and store it Adding User Directory to PHP Upload Form - Help (0) Alright I am trying to have a PHP FTP Upload Form that allows the user to create the directory Warning, may be many pics so if your on a slow connection it migth tak (1) I personally own MANY pets and my GF and I have a thing for taking pictures of them (They usually As in, which directory? (1) I recently got approved for hosting. I have an account right now, but I don't know which When I try to upload files, it says "File uploads are restricted t (2) I have a Qupis account otivtech.qupis.com. Now when I try to upload files using the file manager, Imagefilez TOS re-visited (5) Hi Guys, Starting on with Good news first. We have moved Imagefilez.com on a new & more faster cPanel issues and can't upload files (14) A few days ago I tried to log into cPanel on my site ( www.liamssite.trap17.com ) and it didnt work. How to Add ghost in your pics. Let peoples wondering is ir a real ghos (5) First, you need source pic. I labelled the source pic as S . Heres my source pic: Look spooky File upload (1) I need to add a facility on my customer's website so his clients can send him jobs, typically In need of batch upload script (1) I'm in the process of making a photo gallery script. I need ideas on how to make a batch upload with some pics (2) I am wanting to make a Text based RPG... (not multiplay)... how do you sugest i get started... i changing upload limit (0) I recently purchased I.P Download Manager(The download manger that you can purchase from invision It's not finding the files I upload. (5) I downloaded the zip version of the SMF, from www.simplemachines.org I am using SmartFTP, to upload earn a lot of money on discussion and upload image (16) The site is mylot and all you have to do is stay active in the site by creating or responding to (3) I have a windows based account and would like to know how to upload my database to the server. bad filenames (5) Hi there i am new to computing host free web hosting.. and I try to upload a php script file.. all (3) Would it be allowed to have an upload script to transfer text files (homework) from laptop to Snap some pics and post em' (13) Just wanted too see what everybody works at there computers, maybe this would be a fun post to joing to tripd idnt it funny.........specialy the pics remind me of th (6) her r some pics...of a trip that i presented...LOL............ check this 2.... Just register, and share files with anyone. (8) It not only offers you 1 GB free, but you can see after you register (don't need to be activated (4) Does anyone know how to upload a file and form data to a server? What i want to do is allow a user Problem with Mambo (5) Hello! When I am trying to upload a component in joomla (I upgraded from mambo, I had the same New Google gadget - you upload thru them (7) Google Base is a place where you can add all types of information that Google will host and make Please take a look. (8) Heres a link to a few skateboarding pics i did a while back. well a week or something. its my frist Download and upload speed test (51) Ok here goes... I'm a little curious about your internet speed, as you know broadband getting (37) Do not Extract files and then upload them by ftp, try the following (1)open the file manager complete *working* guide on how to test your php pages (57) In this tutorial, I'm going to show you how to test your PHP pages without the Internet or (3) i need some help with a file upload script. i have it so i can upload files from my computer, but i I am getting mine! (25) To get your free Ipod 1.) Click here to sign up! Then click Next. 2.) Enter your shipping Looking for upload, pics, php
|
|
![]() Upload Pics With Php? |
| ADD REPLY / Got an Opinion! | Remove these ADs! | RAPID SEARCH! | Free Web Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|