Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add a Browse box at login.php


chrisjchrisjchrisj

Recommended Posts

Posted

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.

Posted

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>';
}
?>

Posted

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...