Solved

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

Posted on 2014-04-15
2
265 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

743 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

14 Experts available now in Live!

Get 1:1 Help Now