This is probably not the correct forum to post this in but I couldn't find a WebUpload forum. I just need to know how to access the WebUpload control's equivalent to the asp:FileUpload control's FileBytes object. With the FileUpload control I can access the contents of the file as a byte array by accessing FileUpload.FileBytes. I need to be able to do this because we're not allowed to upload files to our webserver. Therefore, we have to capture the bits and put them into a MemoryStream. Once we've done that we can create an in-memory Zip file and email the file contents. Is there not an equivalent object in the WebUpload control like the FileUpload control's FileBytes object?
The WebUpload control looks for a key called fileUploadPath in the web.config to know where to upload a file. The value attribute of that key points to a file path. Since we can't upload to disk I guess the question is how do I specify a MemoryStream as my fileUploadPath?
Hi DTMartinUPS,
For now we have not implemented such functionallity - WebUpload could save file content directly on files for now. In future we can implement such feature.
Regards,Miro Hristov
Normal 0 false false false EN-US X-NONE X-NONE
Unfortunately that won’t work as we can’t upload files even to a temporary folder.
Hey DTMartinUPS,
What exactly is your case - I mean can you describe in details your problem - and how you have configured your WebUpload.
Thanks,
Miro Hristov
It's been a few months since I tried to use the WebUpload control so I couldn't tell you much about how I configured it. I can tell you that company policy prohibits uploading files via the web to even a temp folder. With the asp:FileUpload control that's not a problem as it allows you to access the bitstream buffer in memory which can then be turned into, say, an in-memory Zip file and FTP'd to a folder. When I first tried to use the WebUpload control I asked how could I access the bitstream in memory and the answer from Infragistics was that there is no way but they would look into making it available in a future release. If there's a way to configure your control via the web.config then I'll try it out.
Remind me how you specify the temp folder in web.config for the WebUpload control. Is it possible to tell web.config to use a memory buffer instead of a temp file?
Soon we will implement this feature - so user can save file directly to file stream. But till then you can use some workaround - attach to server-side event UploadFinishing and when the file is uploaded into the temporary file to cancel this event and to save this file to file stream - to ZIP it and move it to another folder. I know this is not the best solution but for now this is some workaround. Soon we will implement to allow user to upload files directly into memmory buffer.
Thanks,Miro Hristov
How soon? I'm not in a big hurry at present because we long ago worked around the problem by using the asp:FileUpload control instead. However, we are always looking at new development coming down the pike that involves file uploads so we're still very interested in a permanent solution. If the temporary workaround is relatively straightforward I can take a look at it. Otherwise, I can wait for your permanent solution.