473,769 Members | 5,846 Online
Bytes | Software Development & Data Engineering Community
+ 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.Fil eSystem.Special Directories.Tem p it works,
but I'd really rather it be written to the folder mentioned above.

Is there something I'm missing(permiss ions 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 3465
"Alan Sloan" <No****@comcast .netwrote in message
news:%2******** *********@TK2MS FTNGP06.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.Fil eSystem.Special Directories.Tem p it works,
but I'd really rather it be written to the folder mentioned above.

Is there something I'm missing(permiss ions 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.saunder s at trizetto.comwro te in message
news:OO******** ******@TK2MSFTN GP03.phx.gbl...
"Alan Sloan" <No****@comcast .netwrote in message
news:%2******** *********@TK2MS FTNGP06.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.Fil eSystem.Special Directories.Tem p it
works,
but I'd really rather it be written to the folder mentioned above.

Is there something I'm missing(permiss ions 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
8506
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 problem. The program may crash unexpectedly while writing to the file. If so, my program should detect this during startup, and then (during startup) probably delete the data added to the file and redo the writing operation.
1
9904
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 more operations were skipped. Warnings were encountered. Review generated source comments for more details.
0
1011
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 with third party api. So I am using a .h file and a .lib file that comes with this api. I've placed the actual .lib file in a bin directory that I created with the project.
1
1228
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 strange part is that the name of the assembly can vary, and has nothing to do with the names of the assemblies used in neither the WebService or the
8
4195
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 this without .config file only with some configuration
0
944
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 (windows 2000). Line 256: <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> Line 257: <add assembly="System.Web.Mobile, Version=1.0.5000.0,...
0
1091
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 got the same error when I access the webservice through IE directly. The following is the error message: line 196£º <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
0
755
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. The same code works fine in a standalone app. I have inspected System.Runtime.Remoting.dll with ildasm, and I can see the ....Channels.Http namespace there. I verified that the virtual directory is configured to use v2.0.50727 (the error message...
5
1275
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 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\vpmeventswebservice\8c9c80a1\1aef049\assembly\dl3\8c26e22b\fd667eb1_fef7c801\VpmEventViewerServer.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET...
0
9586
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9861
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5298
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3956
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 we have to send another system
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.