"access denied" when writing to disk from vb.net

L

Loane Sharp

Hi there

I'm using VB.NET and Office Web Components to access a SQL Server 2005
Express database and draw pictures on the fly in my ASP.NET application.
Using .ExportPicture to write the GIF/JPEG/PNG image to disk and then load
it into the page using the <IMG /> tag is probably not the tidiest or most
secure way of doing this, but it is the easiest and allows the greatest
flexibility in terms of positioning. (It also seems to be the most popular
method, judging by the newsgroups.)

However, the parser gives an "Access denied" error message at the line
containing the .ExportPicture command. The same set of code, run on a
different machine, doesn't give this error. So I'm assuming that it's a
security issue related to the application's attempt to write the GIF file to
disk and took the following diagnostic steps.

While trying to isolate the problem, from <Control panel> <User accounts> I
gave the ASPNET account write permission. From Windows Explorer, I
right-clicked the wwwroot folder, selected Properties and followed the
Security tab and added the ASPNET account with write permission on the
folder. I must have tried at least a dozen other things to get this right,
but without success.

I'm keen to solve the "Access denied" problem of course, but I'm also
interested to know why there are so many independent methods of establishing
write permissions on the file system.

I'd greatly appreciate a reference and a pointer in the right direction.

Best regards
Loane
 
H

hashimisayed

Hi,

Definately sounds like a security issue but "access denied" could also
mean that something else is accessing the "thing" already. Have you
looked into that. I would also suggest that you add ASPNET to the
"admin" group on the machine, just for debugging sake, to eliminate any
security issue.


Thanks,

Sayed Y. Hashimi

http://www.sayedhashimi.com
Shameless Book Plug: Service-Oriented Smart Clients with .NET 2.0
http://www.amazon.com/exec/obidos/t...f=sr_1_1/102-5068238-6758524?v=glance&s=books
 
L

Loane Sharp

thank you for your suggestions. I tried adding ASPNET to the admins group
for testing purposes, but still the same problem, so perhaps the problem of
the component being in use by some other process is correct, I'll check it
out, thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top