Upload using PHP
In the middle of creating my first ever website after teaching myself HTML over the past 5 or 6 weeks.
I would like to create an upload area where clients can upload certain file types up to 100MB in size to a folder on our server. Of course once I get it working, it will be then password protected.
It is a simple form with an upload button. Here is the form http://www.dev.kenwhitesigns.co.uk/client-area.html
Can someone direct me how to amend this form and create a .php file to allow this?
I had it working a couple weeks ago, so I know it will work. I just can not for the life of me remember how I did it and foolishly I did not save the script anywhere for future use.
Any help would be much appreciated. :D
1. Info about PHP uploads.
If you need help with specific code issues, please post your code.
2. Don't make security an afterthought. Adding security after-the-fact will lead to security holes.
Just wondering. Is it an upload area for each particular client where they can login and manage their own resources? Or is it a generic client upload area where they can just upload but not delete/edit - more of a one-stop-dropoff point?
If you could let us know a bit more about the features you'd need and what you'd like to do with the uploads once they're on the server, maybe we could recommend a pre-made script package with security already taken care of.
After looking at your web page, maybe you can kill two birds with one stone and use a contact form with anti-spam captcha that only allows specific file upload or a certain size?
Alternatively, depending on how big you imagine this service will get (allowing for expansion) and who you need to manage the uploads/messages/job specifics in the backend (non-techy types who you don't want poking around in FTP), you might even like to think about something like the free version of Form Tools http://www.formtools.org/ . Use it to easily process and manage any form of your making, add captcha, validation, allow uploads (limit file type and size), send receipt emails to you and the 'submittee' and even create simplified 'client' accounts so your non-techy work mates can view form/upload submissions through the backend admin panel. You can even create hidden form fields which is a handy way to make notes in the backend to log which submissions have been actioned.
It's actually fairly simple to do this yourself as opposed to using something like formtools:
true, but formtools is a very nice utility. Has lots of stuff set up to keep things organized.
In any case, I think we need to hear more from the OP before deciding on a course of action.
I'm a fan of Form Tools - can't you tell ;) I just threw that in as an option while we dont know all the details.
Originally Posted by traq
I agree that it might be overkill for smaller projects (that's why I thought that a contact form with attachment field might be suitable for now) but it's good to consider other options with a view to 'future-proofing' and expansion, and that's where I believe Form Tools can potentially solve a lot of organisational problems.
There are so many possibilities for where and how it can be used (for external/frontend form submissions or internal/backend data input), not to mention it being so convenient for managing all website forms via one interface, so it's a good tool to have in your arsenal.
Thanks for your responses.
It will simply be used as a drop off point. It will not allow access to customers to edit, delete, view or remove files. I would like to leave it in a dedicated area rather than incorporate it in to the contact area, simply because sometimes it is nice for customers/clients to feel that there is a special area within our website just for them (as this will be used mainly by regular and existing customers).
Our company is only a small business with few staff so I can control the back end ftp access and editing fairly easily so I am not particularly concerned with this area.
I will have a look at form tools. But will probably prefer using a simple php script.
IMO, OP's just starting out, so it's better for them to learn to do these things themselves rather than relying on things like formtools, however good it may be.
It certainly is better to learn how to do things - trial and error is going to give anyone a better understanding of how and why we do certain things, and smaller projects often present prime opportinities to test ourselves.
Form Tools is just an option that would be better used for larger-scale data-submission/collation/organisation.
spiper would of course need to evaluate the merits of both points based on his/her own requirements :)