0

I am getting the below error while trying to upload a text file from client machine to a linux shared file. Before the shared file was on a Windows machine, there I did not get the error.

enter image description here

The annoying issue with the error is: it happens some times and it does not happen other time. So cannot reproduce it.

Now, is there any thing ( specially) I need to check if a linux folder is used with ASP.NET 2.0

Edit 1: The below details from debugger:

System.IO.IOException was unhandled by user code Message="A device attached to the system is not functioning.\r\n" Source="mscorlib" StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode) at System.Web.HttpPostedFile.SaveAs(String filename) at LoadFile.Button2_Click(Object sender, EventArgs e) in r:\TimeCard\LoadFile.aspx.cs:line 138 at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Edit 2: I'm using the below code

                FileUpload1.PostedFile.SaveAs(mAttachFileName);

where mAttachFileName will be \\LinuxShare\Share\Emp\123.txt

Rauf
  • 12,326
  • 20
  • 77
  • 126
  • http://stackoverflow.com/questions/31754821/thread-was-being-aborted-after-response-redirectdefault-aspx/31755148#31755148 – IrishChieftain May 07 '17 at 13:47
  • @IrishChieftain, I don't have Response.Redirect in the event. I have tested the code 15 times, and it worked 11 times and failed 4 times. – Rauf May 07 '17 at 14:58
  • Very odd Rauf, can you post the relevant code? I'm thinking it's either a physical error or maybe a permissions issue? – IrishChieftain May 07 '17 at 15:03
  • @IrishChieftain - Added the code. – Rauf May 07 '17 at 15:13
  • Can you show the surrounding, relevant code? Is there a Using statement, etc? This tells us nothing... – IrishChieftain May 07 '17 at 15:15
  • There is no 'using' command. We just prepare the file name and use the function to save to the shared folder. – Rauf May 07 '17 at 15:21
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/143610/discussion-between-rauf-and-irishchieftain). – Rauf May 07 '17 at 15:23
  • I can already see from the error that you're using a PostedFile.SaveAs method call. Check the permissions on the share first. Is it on a different domain, etc? – IrishChieftain May 07 '17 at 15:23

0 Answers0