J
John
Hi all:
I have a web application that plugs into to allow users to read local files
and then upload those files to Sharepoint, but for some reason when I try to
run the code from a client machine (it works fine on the server) I get the
following exception:
System.IO.IOException: The device is not ready.
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)
at WebService1.WebForm1.uploadDocToSts() in
c:\Inetpub\Development\stsupload\upload.aspx.cs:line 141
Here is the code:
try
{
// Grab the local file and read it into the buffer
FileStream fStream = new FileStream(sFileName, FileMode.Open,
FileAccess.Read);
byte[] byteBuffer = new byte[fStream.Length];
fStream.Read(byteBuffer, 0, Convert.ToInt32(fStream.Length));
fStream.Close();
}
catch (Exception F)
{
txtDebug.Text += "File Error " + F.ToString();
}
Can anyone make a suggestion?
John.
I have a web application that plugs into to allow users to read local files
and then upload those files to Sharepoint, but for some reason when I try to
run the code from a client machine (it works fine on the server) I get the
following exception:
System.IO.IOException: The device is not ready.
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)
at WebService1.WebForm1.uploadDocToSts() in
c:\Inetpub\Development\stsupload\upload.aspx.cs:line 141
Here is the code:
try
{
// Grab the local file and read it into the buffer
FileStream fStream = new FileStream(sFileName, FileMode.Open,
FileAccess.Read);
byte[] byteBuffer = new byte[fStream.Length];
fStream.Read(byteBuffer, 0, Convert.ToInt32(fStream.Length));
fStream.Close();
}
catch (Exception F)
{
txtDebug.Text += "File Error " + F.ToString();
}
Can anyone make a suggestion?
John.