Welcome Guest Search | Active Topics | Sign In | Register

Uploand and Download Question Options
drj
Posted: Wednesday, December 30, 2009 1:53:50 PM
Rank: Member
Groups: Member

Joined: 12/18/2009
Posts: 11
Hi,

I just sent Farpoint technology a question with regard to upload and download of exported files. They have the capability to save there output to a memory stream rather than a file on the server.

Does your download product have the capability to take the file out of a memory stream for download to the user's machine.

Conversely, does your upload product have the capabilty to upload into a memory stream.

I am trying to avoid creating files on the server for purposes of upload or download.

Thanks for your help.

DRJ

Hi,
I just started using the WEB product , I have been using windows. My problem is with the WEB product.
My objective is to allow the user to download my Farpoint Spread to his computer in Excel format.
Your program allows the user to perform SaveExcel , one of your examples show that one can Save Excel to a memory stream.
I like this approach because it avoid saving a file to the server when all the user wants to do is to download the resultant excel file to his or her machine.

The procedure shown in your portal doc. Shows this.
' Save data to memory stream and then load in second component.
Dim s As New System.IO.MemoryStream()
FpSpread1.SaveExcel(s)

My questions is now two fold.

1. If I download this memory stream to the user’s machine will it come up in Excel as an Excel Spreadsheet.
2. I am currently using Essential Objects download tool. But that is secondary , the question is – can I specify a memory stream a file to download.
It appears that if I can do this then one can save and download from a Farpoint application without saving a file on the Server.
Can you give me any advice or direction on this matter. Maybe there are other solutions , really one wants to avoid writing or reading temporary files to
the server.

Thanks
DRJ
eo_support
Posted: Wednesday, December 30, 2009 2:08:59 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Yes. You can do both.

Here is a working example for downloading without saving into a file:

http://demo.essentialobjects.com/Default.aspx?path=Downloader\_i0\_i4

You can take a look of the sample source code to see how it works. Basically you get a writer with which you can write out your download contents to the client directly. While it does not create physical file on your server, you still need to specify a file name. The name itself is not very important, but the extension for this name is important because that's what the browser uses to determine what program it uses to open the download.

You do not need our uploader to upload a file without saving into a file. The standard ASP.NET FileUpload control works that way. The very reason that user uses our uploader control is because our control streams upload contents into a file. This is very important so that it can handle large uploads. ASP.NET FileUpload can not handle large upload because it keeps the whole file in memory (thus it is not exactly a memory "stream", but a huge memory block).

Even though our uploader does write into physical files, it is done through temp files and it automatically cleans them. So all you need to do is to provide it a writable directory. Once user uploads a file, you will get a temp file name, you can then do whatever you'd like with that file and once you are done, the file will be automatically deleted by the uploader.

Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.