Copy link to clipboard
Copied
Hello,
I have a bit of a challenge I have yet to find a solution for.
I have a Coldfusion 9 application with a SQL Server backend.
I have the user entering mulitple items and as they enter them, they are stored in a Session Structure. One of elements of each of the items they are entering is a file. Therefore the path to their file is what gets stored in the structure.
When they are all done, they click the "next" button which is supposed to take them to a screen that then uploads all the files related to the items they were entering.
My customer has indicated he really does not want the file load process to occur until all the items have been entered and then he wants them to see progress bars as the files load.
Anyone have any thoughts or suggestions around this? I am a little stuck. Thanks!!
DMX
Copy link to clipboard
Copied
If I am understanding this requirement correctly, your challenge may nigh be impossible.
If what you are asking is for a user interface where local paths are input that is then sent to the server. Then once the input process is done, the server 'uploads' all these files from these paths. That is not how web applications work. The server has NO connection to the server. It can not 'get' any files from the server.
How HTTP file upload works:
1) you put a 'file' form control in a web page.
2) the clients browser renders the file form control.
3) the user uses the form control to select a file on their local system.
4) the user hits submit
5) the browser gets the file from the local system, encodes it into the request and sends the request to the web server
6) the web server sees that there is a file included in the request, it decodes the file and saves it to a temporary space on the server system
7) the web server passes the request to the ColdFusion application server, telling ColdFusion about the temporary file
9) the ColdFusion server does what ever it has been programmed to do with the file from the temporary space.
There is no way that I am aware of to accumulate several files over many requests and then have the server get them all at once at the end with normal HTTP protocol.
If you want to go beyond HTTP wiht something like flex|air|flash, this might be possible. But not withing the normal HTTP request/response cycle.
Copy link to clipboard
Copied
Thanks so much Ian.
That is actually what I figured the answer was. I figured though, no harm in asking if anyone knows a way to do something like what I am asking.
The reason behind the decision my customer made to put the functionality in the order I described is, historically his web app would load one file at a time when the form was submitted but the upload component he was using (whatever it was) showed no progress to the customers and often his customers would just leave the site thinking it was not functioning because it did not appear as though the file was being loaded.
Since I will have little choice but to stick with the normal method of loading a file, could you make any suggestions on what components or methods would be best for this to ensure the user sees something happening as the file loads?
I have been away from CF development for two-three years and I know a fair amount can change in that time so I appreciate any suggestions you can make.
Thanks again so much Ian. I really appreciate the time and thought put into your response.
DMX
Copy link to clipboard
Copied
The simpliest solution would be some simple text explaining what is going on, what will happen and that it might take a few moments.
A fancier solution would to to use some ajax where one could pole the server and check for some status. That would take some real thinking, and I have no suggestions on actual code. But I can kind of see how the idea might work. Maybe some type of javascript loading animation the runs until another function polling the server tells it that the upload is finished.
The fanciest solution would be go beyond a simple HTTP web page, and use something "Web 2.0ish". Adobe would suggest the Flex|Air|Flash. This solution would allow for a very desktop like experience, but one would have to accept the application, or at least the file loading portion of it, would run in a flash player.