Html: Download Files and Respond

    For a particular web application a user has selected to download a file but since the files is extremely large it will take sometime for it to return. In the process of write out this task, I knew already how I wanted the process to appear. However I didn't give it too much thought as to how I would implement it since I have multiple possible ways to approach it.
    To make a long story short I ended up doing what I've seen before with Google Drive and just made a button that would direct to a new tab and return the content type in the headers. What this does is allow the user to see a response without impacting the whole page. Note that I used a button instead of a link. Inside the button and create javascript function for the onclick attribute. Inside that function I simply called window.open. There is two reason why I didn't use just a link, the first is I had no clue what the link would point to until the user was done making a selection. The second was because I didn't want there to be a race condition between the UI and where the link points to. If the user clicks on the link and the url isn't completely finish being created the link might break off go somewhere unexpected. 

Resources

Comments

Popular posts from this blog

Nginx Best Practices Extended

Installing Windows on Acer chromebook 15 cb3-532

Entity Framework: ToListAynsc & WhereAsync