Click here to Skip to main content
16,004,602 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hello All.

When i use the input type file and then browse on local host it work fine
the input file syntax is

<input type="file" name="fileDetails" id="fileDetails" />

but when i deploy the project on server then it always take the another path and throw an exception. on server it finds the file in iis folder and not take the browse path

So can anyone please provide me the appropriate solution for the problem?

Thanks In Advance..................
Posted
Comments
Jameel VM 5-Sep-13 2:06am    
what is the exception?
Tilak Rathour 5-Sep-13 2:24am    
The Exception is
Cannot find the file on windows/system32/inetsrv/test.xlsx

1 solution

You should put the below code before you specify the path
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

Hope this helps
 
Share this answer
 
Comments
Tilak Rathour 5-Sep-13 4:59am    
Thank You Jameel

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900