It sometimes amazes me that after being in web development for as long as I have, some things can still jump up and bite you if you haven’t run into them before. This past week I ran into one such occasion.
I was developing a web-based “FTP” application for one of my clients, with Job 1 being “it has to work on the Mac”. The previous application that had been developed for this client by a third-party was clunky to use, both from a front-end and management area perspective, oftentimes would not work quite right, and many times outright fail – and 95% of the system errors occurred on Macs due to the way the code was written. Cutting out a lot of the details, the new system proposed would work like so… a front-end user would log into the system, be able to manage their previously uploaded files or view files that my customer had sent to them via the application, or upload a new file. If they uploaded a file, the page they looked at contained a few form fields which would be inserted into the database, which mostly helped track which Job Number the file belonged to and some other relevant data, a comments field, and the file field itself. The page also included two iframes, one hidden and one visible; we had decided to go with a simple remote scripting solution because we felt in the interest of the client’s budget that we wouldn’t try and implement anything fancier. In order to keep the user looking at the page they were currently on, the form had the target attribute point to the hidden iframe where it could process the information but otherwise keep the user in “stasis”: the second iframe would load a fairly standard progress bar upon form submission which would reload itself to allow user feedback for the user uploading the file, letting them see how their upload was doing as they waited. Once the actual processing script was complete, with the file written to the server’s hard drive and the database inserts all doing what they needed to do, an alert would be raised to the user letting them know the upload was successful and they would be redirected back to their main view.