An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Problem with FileUpload Control
Adeel Mirza
21
Reputation points
I am using this source code for file upload.
if (ImportFile.HasFile == false)
{
EmptyFile.Text = "Please select a file";
EmptyFile.Visible = true;
return;
}
In the local PC its working fine. But the Server where I am hosting if the file isn't selected, it throws this exception.
System.IO.DirectoryNotFoundException: Could not find a part of the path 'F:\Maverick\Projects\ProjectName\FilesUpload\'.
What I do not understand is in the server, why it skips the above condition? Does it have anything to do with the version of Visual Studio and .NET?
In Local PC, I developed the project in Visual Studio 2017 but the server I am hosting it has Visual Studio 2013 not 2017
Developer technologies | C#
Developer technologies | C#
Sign in to answer