Last post Feb 06, 2019 06:30 AM by Wei Zhang
Feb 04, 2019 02:48 PM|jsshivalik|LINK
I have application installed in c:\inetpub\wwwroot . I am accessing application with below Url . 184.108.40.206 is the Public Id. Local Id is 192,168,1,12 on which IIS Server is installed.
I am able to save file with below code i another drive
string Path = @"e:\Doc\" + filename;
What should be the Url to view the file.
Feb 05, 2019 02:46 AM|Nan Yu|LINK
Hi jsshivalik ,
In your application you can grant permissions for your folder to the application pool , so that your application could access other local disk drive . But i don't think you could directly view the file by entering the url in browser's address bar .
Feb 05, 2019 02:53 AM|KathyW|LINK
The file is not being saved in a folder inside your site, so there is no URL to it. If you can map the folder you are saving the file in to a virtual directory inside your site, you could then access it with a URL in your site. (Of course the easiest
thing would be to save the files to a folder inside your site in the first place, if you intend to make them visible to your site visitors.)
Feb 05, 2019 04:42 AM|jsshivalik|LINK
Since i am able to save file , there must be some way to view also
Feb 05, 2019 09:18 AM|jsshivalik|LINK
If Website is in d:\test. I want to save file in d:\Doc which is not in Website folder . How i can save the file in Doc and then View the file
Feb 05, 2019 09:43 PM|KathyW|LINK
I told you in my earlier reply. Map d:\Doc to a virtual folder inside your website, so you can link to it.
Feb 06, 2019 02:22 AM|Wei Zhang|LINK
According to your description,if you want to view file which is not in Website folder, you could set the permission of folder that it could be write and read. You could follow the steps as below I hope it could help you. .
1.In Windows Explorer, right-click the folder whose permissions you want to change, and then click Properties.
2.Click the Security tab.
3.Add Authenticated Users and give them Full Control.
5.In the Advanced Security Settings dialog box, click Enable inheritance.
it shows as below:
Feb 06, 2019 05:14 AM|jsshivalik|LINK
I am able to Save file in that folder. Now i want to open file which i am not able to do.
Feb 06, 2019 06:30 AM|Wei Zhang|LINK
Now i want to open file which i am not able to do.
If you want to show file just by enter the url, you should use Response.WriteFile(filePath) in page load event. For example if the file you want to show is a pdf file , you could write as blow:
protected void Page_Load(object sender, EventArgs e)
string filePath = @"e:\Doc\" + filename;// enter the address of file
Response.ContentType = "application/pdf";// alert the type of file
Then you could directly enter the url of aspx which you want to show the file. I hope it could help you.