Re: Problem creating folder in C# Asp.Net
- From: "Zeb" <m.winward@xxxxxxxxx>
- Date: 1 Feb 2007 03:25:48 -0800
On 1 Feb, 11:22, JE <jgegroups.s...@xxxxxxxxxxxxxxxx> wrote:
You have to configure the security on the folder give the ASP.Net
account the necessary permissions.
Zeb wrote:
Hi all
I've developed a shopping cart in C# and to allow moderators to upload
product images, news images and downloadable PDFs, the app creates a
folder for each product. I start out with the following empty folders:
/img/products/
/img/news/
/pdf/
When a new item is uploaded, the app first creates a folder in the
appropriate place and the folder is named using the product or news
ID. The uploaded files can also be deleted later if necessary.
This works fine locally, but won't work on the remote shared server.
When I try to create the folder on the uploaded website I end up with
the following exception:
"Request for the permission of type
'System.Security.Permissions.FileIOPermission, mscorlib,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed"
I'm using DirectoryInfo.Create to create the new folders.
Interestingly, I wrote a quick ASP3 script that creates folders in the
root of the site and this works fine.
I did read a post yesterday that suggests the aspnet client needs read
access to the root of the physical drive (in this case, D:) to be able
to create folders and that most shared servers won't allow this.
Is this really the case, and if it is, what's the best solution? There
must be a way to dynamically create folders on shared hosting
servers ....
Many thanks for any helpful suggestions!- Hide quoted text -
- Show quoted text -
What are the necessary permissions though? The ISP seem to think that
the permissions on that folder will allow the creation of new folders
by the aspnet account ..
.
- Prev by Date: ASP.NET Security
- Next by Date: Re: Certificates and web services
- Previous by thread: ASP.NET Security
- Next by thread: Re: Certificates and web services
- Index(es):
Relevant Pages
|
Loading