473,473 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

WebService Writing temporary file

I've written a web service in VS2005 that uses a COM object to get a file
out of another system. I eventually need to stream the file to the
consumer, but I first need to get the file to a temporary location. I'd
like this temporary location to be a subfolder in my web service. When I
attempt to get the file to /WebService/tmpFolder/filename.pdf it fails. If
I get the file to My.Computer.FileSystem.SpecialDirectories.Temp it works,
but I'd really rather it be written to the folder mentioned above.

Is there something I'm missing(permissions wise or other) that isn't
allowing it to write to a subfolder in my web service?

Any help would be greatly appreciated.

Alan
Apr 16 '07 #1
2 3448
"Alan Sloan" <No****@comcast.netwrote in message
news:%2*****************@TK2MSFTNGP06.phx.gbl...
I've written a web service in VS2005 that uses a COM object to get a file
out of another system. I eventually need to stream the file to the
consumer, but I first need to get the file to a temporary location. I'd
like this temporary location to be a subfolder in my web service. When I
attempt to get the file to /WebService/tmpFolder/filename.pdf it fails.
If
I get the file to My.Computer.FileSystem.SpecialDirectories.Temp it works,
but I'd really rather it be written to the folder mentioned above.

Is there something I'm missing(permissions wise or other) that isn't
allowing it to write to a subfolder in my web service?

Any help would be greatly appreciated.
ASP.NET Web Services, like ASP.NET Web Applications, run in a restricted
context. Part of that context is that they usually run under an account
which does not have access to write to disk.

Take a look at the application in IIS Manager. Look at the Directory
Security tab of the Properties of the virtual directory. Click the "Edit"
button. If you have Anonymous access enabled, then take a look at the user
name that the application runs under. This is the user which will need write
access to your temporary directory, and (I think) List Contents access to
the parents of your temporary directory.

HTH,
--

John Saunders [MVP]
Apr 16 '07 #2
Thanks for your reply. It was in fact the ASPNET account that did not have
permissions to write to the folder in the Web Service.

I have another question related to this, but I will start a new thread for
it.

Thanks!
Alan
"John Saunders [MVP]" <john.saunders at trizetto.comwrote in message
news:OO**************@TK2MSFTNGP03.phx.gbl...
"Alan Sloan" <No****@comcast.netwrote in message
news:%2*****************@TK2MSFTNGP06.phx.gbl...
>I've written a web service in VS2005 that uses a COM object to get a file
out of another system. I eventually need to stream the file to the
consumer, but I first need to get the file to a temporary location. I'd
like this temporary location to be a subfolder in my web service. When I
attempt to get the file to /WebService/tmpFolder/filename.pdf it fails.
If
I get the file to My.Computer.FileSystem.SpecialDirectories.Temp it
works,
but I'd really rather it be written to the folder mentioned above.

Is there something I'm missing(permissions wise or other) that isn't
allowing it to write to a subfolder in my web service?

Any help would be greatly appreciated.

ASP.NET Web Services, like ASP.NET Web Applications, run in a restricted
context. Part of that context is that they usually run under an account
which does not have access to write to disk.

Take a look at the application in IIS Manager. Look at the Directory
Security tab of the Properties of the virtual directory. Click the "Edit"
button. If you have Anonymous access enabled, then take a look at the user
name that the application runs under. This is the user which will need
write access to your temporary directory, and (I think) List Contents
access to the parents of your temporary directory.

HTH,
--

John Saunders [MVP]


Apr 17 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

48
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential...
1
by: ffhansix | last post by:
Hi, I am having problems with generating a c# proxy class from a IBM websphere WSDL file, when running the wsdl.exe to create the c# proxy file command i recieve an error: Warning: one or...
0
by: Sharon McCarty | last post by:
Hi Everyone, I'm creating a webservice that's written in C++. So, I'm using the wizard by creating a c++ project using the template, ASP.net Web Service. I am trying to make method calls...
1
by: Ricky K. Rasmussen | last post by:
Hi NG, When connecting to a local WebService one of our customers gets a very strange exception: "File or assembly name gaw9eaqv.dll, or one of its dependencies, was not found." The...
8
by: Topper | last post by:
Hello. I have simple web folders structure: -ROOT - BIN WebService.dll WebService.asmx I need to use my WebService.dll not in bin folder - for example, in ROOT. How do i this? How can i do...
0
by: anders.henriksen | last post by:
Hi I'm trying to communicate between a tird party system to my webservice and I get the following error message. The third party system (called envox) and my webservice are on the same server...
0
by: Standist | last post by:
vs.net 2003 I create a webservice using vc.net.In the webservice invoked a method in a dll from third party. I compile and link the program without any error.But I got a error when I debug it,I...
0
by: Kirk | last post by:
I'm trying to use a Web Service to be a Remoting client of an existing ..NET 2.0 server. But I get the following error when I try to use System.Runtime.Remoting.Channels.Http in my WebService. ...
5
by: eschneider | last post by:
I get the following error when I build, anyone know what the problem is? Error 1 The type 'VPMEventViewerUtil.DataTransferObject' exists in both...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.