Best practice for file upload and import
A common feature in applications is the ability for an end user import data from a file. Generally the best user experience is to allow the user to select a file off their hard drive and upload it to the server for parsing and import into the database.
However, there can sometimes be technical complexity associated with file uploads and that complexity often distracts from the business logic. We should first work through the business logic of the import before tackling the technical complexities of uploading, storing, parsing, and cleaning up files.
FIRST create a real dumb import screen that just has a text box in a browser. We can then manually copy and paste into that text box and submit to server for parsing and import. There are many benefits to doing this first.
- Quick to build
- Simple to support
- Avoid file loading complexity and focus on business process first
- Easy to test
- Unit test friendly
- Great fallback should the more complex solution of file loading ever fail
I am NOT saying don’t build a better user experience. I am saying build a simple, easily testable feature FIRST that you always keep in your back pocket for a rainy day.