How to use FileUpload
-
I am using the FileUpload control to upload files from client's local HDD to the server But the code always searches for the file path on the server side e.g. If the user tried to upload a file C:\1.txt from his machine, He gets an exception "Could not find file C:\1.txt" But if there is a file with the same path on the server it works and upload the server file instead How can work around that
foreach(Minute m in MyLife) myExperience++;
-
I am using the FileUpload control to upload files from client's local HDD to the server But the code always searches for the file path on the server side e.g. If the user tried to upload a file C:\1.txt from his machine, He gets an exception "Could not find file C:\1.txt" But if there is a file with the same path on the server it works and upload the server file instead How can work around that
foreach(Minute m in MyLife) myExperience++;
Mohammed Gouda wrote:
But the code always searches for the file path on the server side
Your code is broken. Post the code which you are using for upload.
Navaneeth How to use google | Ask smart questions
-
Mohammed Gouda wrote:
But the code always searches for the file path on the server side
Your code is broken. Post the code which you are using for upload.
Navaneeth How to use google | Ask smart questions
Hey, Navaneeth, Wishing You and Your Family A Very Happy and Prosperous New Year !!!
cheers, Abhijit
-
Hey, Navaneeth, Wishing You and Your Family A Very Happy and Prosperous New Year !!!
cheers, Abhijit
Thanks :) and wishing you too. 4 hours to go!
Navaneeth How to use google | Ask smart questions
-
I am using the FileUpload control to upload files from client's local HDD to the server But the code always searches for the file path on the server side e.g. If the user tried to upload a file C:\1.txt from his machine, He gets an exception "Could not find file C:\1.txt" But if there is a file with the same path on the server it works and upload the server file instead How can work around that
foreach(Minute m in MyLife) myExperience++;
What is the .NET Framework version ?
-
What is the .NET Framework version ?
What is the .NET framework version ? Marcello Turnbull
-
I am using the FileUpload control to upload files from client's local HDD to the server But the code always searches for the file path on the server side e.g. If the user tried to upload a file C:\1.txt from his machine, He gets an exception "Could not find file C:\1.txt" But if there is a file with the same path on the server it works and upload the server file instead How can work around that
foreach(Minute m in MyLife) myExperience++;
Thanks to all participants I solved it I had a server side method as follows
AddAttachment(string filePath)
{
//here is the source of exception
FileStream fs = new FileStream(filePath, FileMode.Open);
//Then I get the data in fs in the form of byte []
}To solve the problem, I changed the method to
AddAttachment(byte [] fileContents)
{
//Then I get the data in fileContents directly
//where fileContent is obtained from the FileUpload control
}foreach(Minute m in MyLife) myExperience++;
-
Thanks :) and wishing you too. 4 hours to go!
Navaneeth How to use google | Ask smart questions
N a v a n e e t h wrote:
Thanks Smile and wishing you too.
Thanks Man !!!
N a v a n e e t h wrote:
4 hours to go!
Ya!!! But Still Hanging in Office :( Hope tonight have a party !!! :beer: Enjoy !!!
cheers, Abhijit