Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 255815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:57:44+00:00 2026-05-11T21:57:44+00:00

I was wondering what’s the best practise for serving a generated big file in

  • 0

I was wondering what’s the best practise for serving a generated big file in classic asp.

We have an application with “export to excel” function that produces 10MB files. The excels are created by just calling a .asp page that has the Response.ContentType set to excel and has an HTML table for the data.

This gives as problem that it takes 4 minutes before the user sees the “Save as…” dialog.

My current solution is to call an .asp page that creates the excel on the server with AJAX and lets the page return the URL of the generated document. Then I can use javascript to display the on the original page.

Is this easy to do with classic asp (creating files on server with some kind of stream) while keeping security in mind? (URL should make people be able to guess the location of other files)

How would I go about handling deleted the generated files overtime? They have to be deleted periodicly as the data changes in realtime.

Thanks.

edit: I realized now that creating the file on the server will probably also take 4 minutes…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:57:44+00:00Added an answer on May 11, 2026 at 9:57 pm

    I think you are selecting a complex route, when the solution is simple enough (Though I may be missing some requirements)

    If you to generate an excel, just call an asp page that do the following:

    Response.clear
    Response.AddHeader "content-disposition", "attachment; filename=myexcel.xls"
    Response.ContentType = "application/excel"
    
    '//write the content of the file
    Response.write "...."
    
    Response.end
    

    This will a start a download process in the browser without needing to generate a extra call, javascript or anything

    See this question for more info on the format you will choose to generate the excel.

    Edit

    Since Thomas update the question and the real problem is that the file take 4 minutes to generate, the solution could be:

    1. Offer the user the send the file by email (if this is a workable solution in you server or hosting).

    2. Generate the file async, and let the user know when the file generation is done (with an ajax call, like SO does when other user have added an answer)

    To generate the file on the server

    '//You should change for a random name or something that makes sense
    FileName = "C:\temp\myexcel.xls" 
    FileNumber = FreeFile
    Open FileName For Append As #FileNumber
    
    '//generate the content
    TheRow = "...."
    Print #FileNumber, TheRow
    
    
    
    
    Close #FileNumber
    

    To delete the temp files generated
    I use Empty Temp Folders a freeware app that I run daily on the server to take care of temp files generated. (Again, it depends on you server or hosting)

    About security
    Generate the files using random numbers or GUIds for a light protection. If the data is sensitive, you will need to download the file from a ASP page, but I think that you will be in the same problem again…(waiting 4 minutes to download)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wondering how to open many new windows with Javascript. I have found plenty of
just wondering if anyone knows of a truly restful Put/delete implementation asp.net mvc preview
Wondering if anyone can help with this. I have a table with some fixed
Just wondering if there is a way to select all controls/items in asp.net/c# like
was wondering how to code a server file for ajax calls ?, example: Class
I'm wondering if it's possible to record an audio file in mp3 format programmatically
Wondering if anyone has gotten the infamous database is locked error from Trac and
Wondering if there is any Text to Speech software available as a plug in
Wondering if I need to do something in my swf to be able to
Wondering if anybody out there has any success in using the JDEdwards XMLInterop functionality.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.