简体   繁体   中英

Corrupt Files after uploading on server

I have a problem with my webapplication. I have made an upload-function for uploading documents. Local on debbuging it works without problem. When I run my application on the server it works also, but the files are after the upload corrupt (eg word-file has only some signs instead the correct text).

I think the error must be somewhere in the server-setting or maybe in webconfig? I search since hours for a solution but can't find a similiar problem (yes, maybe i search with wrong keywords :(

Has somebody a solution? Thank you!

My Code:

<asp:FileUpload ID="FileUpload1" runat="server" /><br />
<asp:Button ID="btnUpload" runat="server" Text="Datei hochladen" onclick="btnUpload_Click" />

Code behind

//some code for save fileinfos in database...
...
...

//Upload File
FileUpload1.SaveAs(path + fileName);

There is no errormessage I could post, because it works obviously all fine. The problem are the corrupt files after uploading on server (local it works)

I can't see the byte array generation code here(the section you have commented above) but if everything is ok in the code, the byte array received from stream is corrupted. It may be because of errors in client side java script codes. But you say that a local test is ok. It may be because of the network settings ?! If packet payloads are corrupted, what you get on server side will be corrupted as well. Do you have any firewall in the middle ?! Any signature matching application ?!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM