chrisjchrisjchrisj Posted April 21, 2007 Posted April 21, 2007 On the page Login/Create An Account" (login.php), I'd like some help with adding a Browse box where a customer can select a file from their desktop and upload it. Typically it's in a web form as a Browse box and Submit button. I'd like it so only registered members can upload, so if you haven't already registered you wouldn't be able to upload. Any suggestions would be appreciated.
♥FWR Media Posted April 21, 2007 Posted April 21, 2007 Firstly i'd say be very careful before you let the public upload files. What checks are you doing on the filetypes? Surefire way to get your server compromised if you don't know what you are doing. Anyway .. something like .. <?php if (isset($_SESSION['customer_id'])) { echo ' <form action="/WHEREVER IM GOING/" enctype="multipart/form-data" method="post"> <p> Please specify a file:<br /> <input type="file" name="myfile" size="40"> </p> <p> <input type="submit" value="Send"> </p> </form>'; } ?> Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
chrisjchrisjchrisj Posted April 22, 2007 Author Posted April 22, 2007 Thank you for your advice and code. Will this code prevent non-registered people from uploading? Regarding uploading, can you suggest a"surefire way to keep my server" from being uncompromised? Suggest a virus protection maybe? Additionally, How/Where can I limit the upload types to just a few specific file extensions? Also, is there any way to store the file size in a database to keep track of how much each registered user uploads? Thanks agin so much.
♥FWR Media Posted April 22, 2007 Posted April 22, 2007 Thank you for your advice and code. Will this code prevent non-registered people from uploading? Yes Regarding uploading, can you suggest a"surefire way to keep my server" from being uncompromised? Suggest a virus protection maybe? Additionally, How/Where can I limit the upload types to just a few specific file extensions? Also, is there any way to store the file size in a database to keep track of how much each registered user uploads? Thanks agin so much. That is a long and complex storey I suggest you google it and find info on secure uploads. Sorry but I don't have the time atm, maybe someone else will elaborate. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.