2

I am writing a client-side script.

I need to read an Excel file from the client location, do some modifications and return it. I can read the file and do the modification but how do I return it?

I also have to consider the performance of the website.

Widor
  • 13,003
  • 7
  • 42
  • 64
joshua
  • 2,371
  • 2
  • 29
  • 58

1 Answers1

1

By "return it", do you mean save it back to the Client location? That's going to be hard if not impossible unless you somehow have write permissions to their filesystem via some horrid ActiveX control or similar.

Instead, you should serve the file using the Excel MIME type and let the user save it to the location.

Take a look at these answers for more info: Setting mime type for excel document

Community
  • 1
  • 1
Widor
  • 13,003
  • 7
  • 42
  • 64
  • yeah i thinking so that...saving back to client location not possible cause may be or not dont have permissions. ** What i have to do for the second things.cause a .xls format can vary in huge size** – joshua Oct 04 '11 at 11:34
  • You can either serve it from the memory stream or if you're worried about the file size, save it to a publicly-accessible directory and redirect the browser to point at the location. – Widor Oct 04 '11 at 11:48