Last post Jul 29, 2015 12:09 PM by Weibo Zhang
Jul 24, 2015 07:05 PM|yvdk7788|LINK
I have created a application which reads CSV and Excel from User uploaded file... Its working perfectly on local machine, But when i deployed in server i am unable to read files....
'D:\arrgh\arrgh\Uploads\countrylist.csv' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
Jul 25, 2015 12:35 AM|KathyW|LINK
Is your hosted server path really what you specified? From the message I assume it is not. You should not hard code the path name. Use Server.MapPath("/Uploads") (assuming the Uploads folder is in the root of your application; adjust the path if it is
not) to get the Uploads folder path.
Jul 25, 2015 09:37 AM|yvdk7788|LINK
Jul 29, 2015 12:09 PM|Weibo Zhang|LINK
That's a client path
Do you means 'D:\arrgh\arrgh\Uploads\countrylist.csv' is a client path? If it’s true, I guess maybe you do some actions directly on this path in your code. You’d better first save the uploaded files and then operator them using the server-side’s
file path. About why you don’t get the file path, you could refer to the "File Upload Control section" in the following article.
The following link also provides an explanation and give a method to save files to server, you cold take a look.
I hope it’s useful to you.