Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

791 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