Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader Create a Stream Object of File Options
sr
Posted: Tuesday, June 24, 2008 9:35:51 AM
Rank: Newbie
Groups: Member

Joined: 6/24/2008
Posts: 4
I am trying to get the FileContent of a file(as a stream object similar to the MS FileUpload.FileContent Method) on the Client without using FileOpen method(as the client will not allow permissions on the Client Directory). I tried the following code:

private Stream FileContent(string FileName)
{
//Stream filestream = new FileStream(FileName, FileMode.Open);

Stream filestream = new StreamReader(FileName).BaseStream;

return filestream;
}

But the File that is uploaded is always corrupt. Is there any way to it? I don't want to use Final file location as I am using a web service to store the files in a File Repository.
eo_support
Posted: Tuesday, June 24, 2008 10:35:24 AM
Rank: Administration
Groups: Administration

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

new FileStream(FileName, FileMode.Open)

should be correct. We are not aware of any problem with file being corrupted. So you might want to check the file manually first with file explorer first. Once you are sure the files are correct, you can then proceed to call your other code. If the problem continues, please post the page online and also make both the test file you use and the uploaded files accessible to us. We can then take a look and see what we can find.

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.