Solved

How to use a folder for Uploading files in it in Asp.net

Posted on 2014-04-15
2
266 Views
Last Modified: 2014-04-16
I have a asp.net site, in it user can uploads files of any sizes. It may include image, documents etc.

Now it is hosted in ISS and I need to a folder which is on D drive "D:\Upload" to store all the files which user uploads.

I have used relative path in my code already.

I need to know is there any way by which I can do some mapping to this folder "D:\Upload"
So that my uploaded files go there instead of my site folder which is  different location and mapped in ISS site.
0
Comment
Question by:yadavdep
2 Comments
 
LVL 22

Expert Comment

by:Mrunal
ID: 40003336
Hi,
you can use physical path, as it is not dependent on your application and application hosting server.

After uploading functionality done, you can raise a request to server to read files from the same location and confirm (alternative solution).

Better way you can keep this path in configuration file and read from there, so that later on you can change it without compiling your application.

Hope this helps you.
0
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 265 total points
ID: 40003421
The correct way to go about it would be to add a "virtual directory" to your site that maps to the folder on the D: drive.

That way you access it as if it was a relative folder in your site, but it will physically map elsewhere.

Guide to creating VDirs: http://technet.microsoft.com/en-us/library/cc771804(v=ws.10).aspx
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now