Web server as File server

Hello experts

Scenario:

i want to upload file on web server. Now i want to store that uploaded file to its hard drive (suppose D:\File).

How can i get the physical path in order to store file.

 

plz reply

fine regards

Ali 

0
aligenius
4/26/2008 6:54:56 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

1 Replies
1070 Views

Similar Articles

[PageSpeed] 17
Get it on Google Play
Get it on Apple App Store

 One way to do this is to create a virtual folder say "Upload" in your web application and map it to the folder where you want to store the files. Now while saving, you can get the physical path by

String sPath = Server.MapPath("Upload");

String sFileName = "abcd.txt" 

File.SaveAs(sPath + sFilename);

Another way is to store the path in the appsettings in web.config and use it for saving your files.

 


Regards,
Prashant


Dont forget to click "Mark as Answer" on the post that helped you.
0
Prashant
4/26/2008 11:58:51 AM
Reply:

Similar Artilces:

unable to start debugging on the web server. the web server did not respond in a timely manner. this may be because another debugger is already attached to the web server.
When i start debugging, it looks like it's going to work and the VS toolbars change to show the debugging toolbar options. However the cursor changes to the "busy" cursor and vista 'ghosts out' VS 2008 indicates that it's "not responding" in the title bar. The web browser never starts up and if you I it several minutes I get the following error: "Unable to start debugging on the web server. The web server did not respond in a timely manner. This may be because another debugger is already attached to the web server." HOWEVER, if you then im...

Move File From Web Server to File Server
Our organization has a web server and file server in the same domain. On our public website ordering page, users have the ability to upload a document. The document is currently saved on the Web server in a temp directory. I need to move the uploaded file off the webserver and over to a specific directory on the file server. I have tried using File.Move to accomplish this but encountered permission errors. How does this need to be set up to work? The code format I have is File.Move ("c:\\dir\\file.ext", "\\\\fileserver\\dir\\file.ext"); Thanks in Advance ...

Unable to start debugging on the web server. The debugger is not registered on the web server computer. Visual Studio or the full remote debugger components must be installed on the web server!
Can somebody help me with this error message i get this when i want to debug my web application. I looked on the web many sites are talking about it but no one gives a good explanation for it. I use VS 2005, My OS is Windows XP professional 64 bits(Maybe this is the cause!) And the web prject is a Shop online. Thanks for your help!!  I think you should register IIS with Framework 2.0; How? run the below command on Command Prompt. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i Hope it will work. Regards,  Ather Ali ShaikhSr. System AnalystGASCO Abu Dhabi,...

Error When Debugging (Unable to start debugging on the web server. Unable to connect to the web server. Varify that the web server is running and that incoming HTTP request are not blocked by a firewa
Hi, When im going to run asp.net website its giving this error. Unable to start debugging on the web server. Unable to connect to the web server. Varify that the web server is running and that incoming HTTP request are not blocked by a firewall.  please help me to solve this problem. Thank you. Pubudu  If you are running your site off of a different machine than you are developing on, you need to install and configure the Visual Studio Remote Debugger on that machine. try to change the address from http://localhost to http://yourIP...   i hope it's worked...mak...

Access local server(LAN Server) from Web Server(Web Application Server)
Hello All I have a local server for my LAN and a Web server(at remote location).Is it possible to access my Local Server from my Web Server ? Thanks MS  ...

web server to file server
h most often web server is alsoused as a file/data server but it my case file server is sitting remotely. The problem is how can i transfer files that have been receive on the web server securely to file/data server and up date its path in db stored on web server. thanks in advance ali aligenius:The problem is how can i transfer files that have been receive on the web server securely to file/data server and up date its path in db stored on web server. Is there file server on the same domain as the web server?If so you can just save the file to a mapped network share on the file se...

Uploading files to a different file server but not web server
Hi, I want to upload files to a different file server than the web server using asp.net, is that possible?I can use Server.MapPath to store it on the same server. How do I save it to a different machine? What all I need? Do I need IP address? Do I need to have a shared folder on that machine? thank u for the help!!! There is only a few built in ways to get a file from one machine to another in windows.  Things like FTP, HTTP, or File Sharing - you are going to need a path to the server.  You cannot upload directly to that server.  You'll need to upload to your web s...

Move files from a web server to another web server
I am migriting my site from asp.3.0 to asp.net and I am used to simply copy files from my dev server to production server when my files are ready to go public. With asp.net I can't do that. What do I need to do before and after I copy my files to the production server to make it work. You can do a simple copy with .NET as well. You can copy all the files and directory structs but you only need the .ASPX, .ASCX, the DLL in the bin directory along with your other 'support' files. Also note that there is a 'copy project' option in VS.NET which will do the above.Mike Schellenberger - MCAD...

how to save file (stored on SQL server) to file/web server?
Hi Experts, I got files stored on SQL server db. I would like to be able to save them onto file/web server. I know how to retrieve them, but not sure how to save to file/web server. Please help. Thanks so much. Below are codes for retrieving file info from sql server:Dim strFileName As String = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQuoteFileID)).Tables(0).Rows(0).Item("QuoteFileName")Dim strFileType As String = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQuoteFileID)).Tables(0).Rows(0).Item("QuoteFileType")Dim strFileSize As Integer = Quote.GetQuoteFileByQuoteFileID(CInt(selectedQ...

Unable to get the project file from the web server
Hello, I had the Commerce kit installed on my machine and working for a while. After uninstalling it using Add and Remove program, I installed it again and now the solution would not open in Visual Studio .net. I get an error saying "Unable to get the project file from the web server" Anyone know what is happening and how I can fix this? Other project that I have on my machine are opening fine. Anyone else have this problem? I cant get it to work, today I re-installed VS.net but am having the same problem. I even tried installing into a different folder but no ...

Unable to start debugging on the web server. The web server is not configured correctly.
Hi everyone, I work on C# project (VS 2008, framework 3.5, default Web Site)  that suddenly started giving me this error : "Unable to start debugging on the web server. The web server is not configured correctly.". The web.config is set : <compilation debug="true" strict="false" explicit="true">. Any help will be greatly appreciated!     Did you try closing and then re-opening Visual Studio?Allan Horwitz Yes Hi, To better understand your issue, please confirm the following information: If we create a simple ...

File upload to a server other than the web server.
I have a very simple asp.net upload page. Everything works great when saving the file locally (web server). Things are getting ugly when trying to save files to a different machine (file server, database server,...) So, when using .SaveAs and passing in the UNC path to the new server location I get an *Access denied* error messgae. When mapping a network drive and using the drive letter in the .SaveAs path I get an message saying parts of the path cannot be found. any ideas? thanks  --tolgaApplication Developer Make sure that the account running asp.net web applicaiton(defa...

Unable to start debugging on the web server. The web server could not find the requested resource
Hi When i try to compile/debug my application i get this popup error. Unable to start debugging on the web server. The web server could not find the requested resource Does anybody know know how to resolve this?   Regards Macker       did you look at this article http://msdn2.microsoft.com/en-us/library/ms165025(VS.80).aspxKumar Reddi No   But i will have a look at it and see if that fixes my problem   Thanks I had this problem in VS 2005 when the IDE was viewing an xml file.  I would press F5 to start debugging and it would show t...

Suddenly get error
I have a web site, installed two copied on a server, one is under 2.0 , another is under 3.5, both worked fine. I moved the server to a different domain, after several days, I tried the web applicaton on them. But I got error on both them when I tried to debug them. I use VS 2005 to debug the 2.0 one, and VS 2008 to debug the 3.5 . They both worked fine, but now both gives error, on 2.0, I get - Unable to start debugging on the web server. The debug request could not be processed by the server due to invalid syntax. on 3.5, I get - Unable to start debugging on the web server. The server ...

How to pull data from a remote server to the web server. Initiated by the web server session.
Hello.I am brand new to asp.net. Just starting to do web development. However I do have extensive software experience developingapplications on local networks, mobile devices, vb.net, vb.net remoting,etc. Here is the senario:    Bob delivers bottled water to several hundred accounts.    Bob keeps all information regarding his accounts in an    SQL server located at site A.  Bob has an ASP.net application    hosted on a web server at site B.  Bob wants to allow his     accounts to log in to the web serve...

Server Unavailable; Unable to start debugging on the web server.
Hello, I tried deploying a Visual Studio 2005 Web Application Project on my Local IIS Server. I used project properties page to create a virtual directory. When I try to execute the web application by hitting F5, I get the following error. Please help me to solve the problem.1 --------------------------- 2 Microsoft Visual Studio 3 --------------------------- 4 Unable to start debugging on the web server. 5 6 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 7 8 <html xmlns="...

saving file to a different server rather than on web server
Dear all , I have a .xls file . I want to uplaod the file on a DB server other than web sever . user selects the file from his/her local system and on clicking uplaod button , file should get uplaoded on a new server which is on intranet. I have written below codestring strPostFileName = flUplaod.PostedFile.FileName; string strOrgFileName = System.IO.Path.GetFileName(strPostFileName);string strFileName = dtTodayDate.ToString()+ "_" + strOrgFileName ; //string strDocLoc = strUpldDir + strFileName; string strUpldDir = ConfigurationSettings.AppSettings["BHCDataUplaod&quo...

How do I get my OES server to see files on my Ubuntu server?
I have a client that will soon have both and I am trying to prepare myself. What is the best way to accomplish this? NFS? I am just learning Linux. Susan -- susantci ------------------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 NFS should work, sure. That should work on every platform ever created, really. It depends on your requirements mostly. What will these files be seen for? Just reading files? Writing? User-based permissions needed? See the files once in a while or constantly? Good luck. ...

copy file from web server to ftp server -- not working!
I've tried numerous iterations of the concept below, but I just can't get this to work.  We have a support page where users can upload files to the web server.  This works fine.  Now there is a request to post them to the company's ftp server.  This is the part I am having trouble with.  The code below gives the error: File Save error: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at ASP.form2_aspx.UploadToFTP(String filename, String ftpServerIP1) in e:\wwwroot\mysite\Form2.aspx:line 1203 at ASP.form2_asp...

Server to Server, both Servers in same Tree
Hi, where could be problem when some time connection is not established after server restart, but some time it is OK. (I waited whole day) Filters are opened for all IP from and to both servers in VPN. Both servers are BM3.7 SP2, NDS Version 10350.19 March 18, 2003 Slave server contain RW replica of the container where the server resides. (I tried also Master replica) here are also licenses for NW6 and BM3.7 Master server is in different replica which is not on slave server. Both servers are on same subnet. Packet capture shows only IP 57 communication from Master to ...

Unable to start debugging. Unable to connect to the web server. Verify the web server is running and that incoming HTP requests are not blocked by a firewall.
I have been using ASP.net 2.0 VS 2005 express edition c# on a single machine with IIS 5.1. Browser is MS IE 7.0. There have been no problems until a few days ago.   Debugging works 30% of the time, albeit very slowly. 70% of the time I get this message: "Unable to start debugging. Unable to connect to the web server. Verify the web server is running and that incoming HTP requests are not blocked by a firewall." This happens for old and new websites alike.   I have: stopped firewalls with no impact. de-registered and registered ASP 2....

Keep getting..."Unable to get project file from server",when using vs.net
When trying to open any existing asp.net project in Visual Studio it keeps giving me the message above. It is also throwing an error when I create the project in the first place, it happens when a dos window is opened, the text in the dos window is running "Common Language Runtime Minidump Utility version 1.0.3705.0" and then VS craps out says there was an error and shuts down. I've re-installed the .net components and framework with no avail, and FrontPage extensions etc.. are all installed. I'm running XP professional and have installed IIS 5.1. This is driving me fec...

Create our own Web Server- free web server
It sounds a bit crazy but I do really hope to do so. Currently the hosting cost for running ASP.NET is expensive comparing to LAMP solution. Now we have free DB, free developer tools, except 'A'- in order to run a productional web server the only choice in Windows is IIS 6.0, which means another couple thousands dollars. If we can create a web server independent of OS, we can run a web server as cheap as $0, provided that we got windows 2000 pro/xp home. The Web Server edition of Windows Server is very cheap actualy. More expensive than a Win XP Home, of course...but defina...

server or no server
i have been looking in to slipstreaming windows up dates over the net work ..i have also been thinking (bad thing to do ) installing the os over the net (image).i know you can do this over win2k server using rras server but could i do this in novell 5.1 with out bulding and paying for a server lience. our network is spread across 6 sites one server to each site a gig backbone on each site but connect by 100 mb line .not knowing novell to well but they seem not to be use the OS and Server to well .any help or info would be useful Nigel, > i have been looking in to...

Web resources about - Web server as File server - asp.net.getting-started

Server farm - Wikipedia, the free encyclopedia
A server farm or server cluster is a collection of computer servers usually maintained by an enterprise to accomplish server needs far beyond ...

Apple's CloudKit gets server API
Apple has made CloudKit much more appealing to developers by adding a server-side API to its framework. This will allow them to add much more ...

Setting up a mailinator-like test mail server with postfix and MailHog
The purpose of this exercise is to set up a mailinator-style mail server under our control. If you haven't used mailinator, it's a free service ...

TIME TO FLUSH HILLARY: Number of Classified Emails Found on Clinton's Bathroom Server Climbs to 1,700 ...
... faucet in Hillary's bathroom. It's also the repeated revelations that she compromised national security by maintaining a email private server ...

Qualcomm hopes a gradual approach to server market will pay dividends
The ARM server market is a dangerous place to be: it's still about promise and there's virtually no money to be made. Some ARM server chip makers ...

FBI confirms probe of Clinton’s server
The FBI confirmed on Monday that its investigation of Hillary Clinton’s private email server continues. MSNBC reports.

Qualcomm hopes a gradual approach to server market will work
The ARM server market is a dangerous place to be: Right now there's virtually no money to be made. Some ARM server chip makers have quit, while ...

Ted Cruz Goes All ‘Office Space’ On Hillary’s Email Server
I don’t know if any of these actors are former porn stars, but this is still pretty good. Now give Ted back his red Swingline. Or else.

Street Fighter 5 servers struggle with demand
Capcom servers have been struggling to meet demand on the release of Street Fighter V . According to reports on Reddit , Steam , and Twitter, ...

Microsoft Intros Web-Based Management Tools With Nano Server Support
A beta version of the Server Management Tools for Windows Server includes support for Microsoft's lightweight OS for the cloud.

Resources last updated: 2/16/2016 11:04:39 PM