write a file to as subfolder of a InetServer location

write a file to as subfolder of a InetServer location

am 14.10.2007 14:43:04 von Thanh-Nhan Le

Hi,
I have an ASP application on IIS server:
http://localhost/myApp
I use ASP and a my own VB activex DLL to create a pdf file and write this
file to a subfolder of the Application folder:
http://localhost/myApp/pdfs

1-
Over IIS I have set the "write permission" for this subfolder.
But each time I receive the message: "Can't open output file (bad filename,
in use by other application)", error 0x80040202

2- a visual basic test application can call this DLL, generate and write the
file without problem to the folder

3- with ASP I generate the file in a normal folder (ie c:\temp), it works
Then my ASP page use FileSystemObject to copy this file to the folder
...MyApp/pdfs
When I call this page there is no error message, but the programm runs utils
the line, where FileSystemObject to copy the file to the folder, then it
stops there. The process is hung (dead). The file is not copied...

How can I do?

Thanks
Nhan

Re: write a file to as subfolder of a InetServer location

am 15.10.2007 10:44:56 von David Wang

You should read these blog entries:

http://blogs.msdn.com/david.wang/archive/2005/08/20/Why-can- I-upload-a-file-without-IIS-Write-Permission.aspx

http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS_User _Identity_to_Run_Code_Part_2.aspx


1. IIS "write permission" does not do what you think. It allows PUT,
not ability to write PDF to a subfolder.
2. visual basic test program does not run with same user identity as
IIS (this is how client-server[IIS] computing differents from client-
side[Visual Basic] computing), so it only shows that the code works
assuming access is allowed. You have shown that your user identity,
likely with Administrator privileges, has access to write to that
folder. However, what is the configured user identity of IIS and does
it have permissions? Do you know what is the user identity of IIS? I
don't think you know the answer to either of those questions, and you
must understand it if you are to successfully write this web
application.
3. normally, this failure will cause an error response to be generated
in ASP. You probably have ASP code which does ON ERROR RESUME NEXT,
which will skip over the error and show no error response because
that's what ON ERROR RESUME NEXT does.

I think you have a simple ACL problem that needs to be resolved. You
can check my blog for more assistance.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//





On Oct 14, 5:43 am, "Thanh-Nhan Le" wrote:
> Hi,
> I have an ASP application on IIS server:http://localhost/myApp
> I use ASP and a my own VB activex DLL to create a pdf file and write this
> file to a subfolder of the Application folder:http://localhost/myApp/pdfs
>
> 1-
> Over IIS I have set the "write permission" for this subfolder.
> But each time I receive the message: "Can't open output file (bad filename,
> in use by other application)", error 0x80040202
>
> 2- a visual basic test application can call this DLL, generate and write the
> file without problem to the folder
>
> 3- with ASP I generate the file in a normal folder (ie c:\temp), it works
> Then my ASP page use FileSystemObject to copy this file to the folder
> ..MyApp/pdfs
> When I call this page there is no error message, but the programm runs utils
> the line, where FileSystemObject to copy the file to the folder, then it
> stops there. The process is hung (dead). The file is not copied...
>
> How can I do?
>
> Thanks
> Nhan

Re: write a file to as subfolder of a InetServer location

am 15.10.2007 12:17:02 von Thanh-Nhan Le

Thank you for your anserv.
Yesterday I must work around. I create a dir "C:\temp\report" and share this
folder as webfolder.
I can write pdf files to this folder, and to show this docu I must call the
link to localhost/report/xx.pdf

Why can I write (with VB dll) to C:\temp\report, when it is also a
webfolder? The setting is the same.

I will read your blog.
Thanks again

"David Wang" wrote in message
news:1192437896.446820.103890@t8g2000prg.googlegroups.com...
> You should read these blog entries:
>
> http://blogs.msdn.com/david.wang/archive/2005/08/20/Why-can- I-upload-a-file-without-IIS-Write-Permission.aspx
>
> http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS_User _Identity_to_Run_Code_Part_2.aspx
>
>
> 1. IIS "write permission" does not do what you think. It allows PUT,
> not ability to write PDF to a subfolder.
> 2. visual basic test program does not run with same user identity as
> IIS (this is how client-server[IIS] computing differents from client-
> side[Visual Basic] computing), so it only shows that the code works
> assuming access is allowed. You have shown that your user identity,
> likely with Administrator privileges, has access to write to that
> folder. However, what is the configured user identity of IIS and does
> it have permissions? Do you know what is the user identity of IIS? I
> don't think you know the answer to either of those questions, and you
> must understand it if you are to successfully write this web
> application.
> 3. normally, this failure will cause an error response to be generated
> in ASP. You probably have ASP code which does ON ERROR RESUME NEXT,
> which will skip over the error and show no error response because
> that's what ON ERROR RESUME NEXT does.
>
> I think you have a simple ACL problem that needs to be resolved. You
> can check my blog for more assistance.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
>
>
> On Oct 14, 5:43 am, "Thanh-Nhan Le" wrote:
>> Hi,
>> I have an ASP application on IIS server:http://localhost/myApp
>> I use ASP and a my own VB activex DLL to create a pdf file and write this
>> file to a subfolder of the Application folder:http://localhost/myApp/pdfs
>>
>> 1-
>> Over IIS I have set the "write permission" for this subfolder.
>> But each time I receive the message: "Can't open output file (bad
>> filename,
>> in use by other application)", error 0x80040202
>>
>> 2- a visual basic test application can call this DLL, generate and write
>> the
>> file without problem to the folder
>>
>> 3- with ASP I generate the file in a normal folder (ie c:\temp), it works
>> Then my ASP page use FileSystemObject to copy this file to the folder
>> ..MyApp/pdfs
>> When I call this page there is no error message, but the programm runs
>> utils
>> the line, where FileSystemObject to copy the file to the folder, then it
>> stops there. The process is hung (dead). The file is not copied...
>>
>> How can I do?
>>
>> Thanks
>> Nhan
>
>

Re: write a file to as subfolder of a InetServer location

am 16.10.2007 01:19:46 von David Wang

I don't know how your VB DLL writes PDF to C:\temp\report.

Please read my blog entry to distinguish between the various "Write"
permissions, which should explain what you observe.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//



On Oct 15, 3:17 am, "Thanh-Nhan Le" wrote:
> Thank you for your anserv.
> Yesterday I must work around. I create a dir "C:\temp\report" and share this
> folder as webfolder.
> I can write pdf files to this folder, and to show this docu I must call the
> link to localhost/report/xx.pdf
>
> Why can I write (with VB dll) to C:\temp\report, when it is also a
> webfolder? The setting is the same.
>
> I will read your blog.
> Thanks again
>
> "David Wang" wrote in message
>
> news:1192437896.446820.103890@t8g2000prg.googlegroups.com...
>
>
>
> > You should read these blog entries:
>
> >http://blogs.msdn.com/david.wang/archive/2005/08/20/Why-can -I-upload-...
>
> >http://blogs.msdn.com/david.wang/archive/2005/06/29/IIS_Use r_Identity...
>
> > 1. IIS "write permission" does not do what you think. It allows PUT,
> > not ability to write PDF to a subfolder.
> > 2. visual basic test program does not run with same user identity as
> > IIS (this is how client-server[IIS] computing differents from client-
> > side[Visual Basic] computing), so it only shows that the code works
> > assuming access is allowed. You have shown that your user identity,
> > likely with Administrator privileges, has access to write to that
> > folder. However, what is the configured user identity of IIS and does
> > it have permissions? Do you know what is the user identity of IIS? I
> > don't think you know the answer to either of those questions, and you
> > must understand it if you are to successfully write this web
> > application.
> > 3. normally, this failure will cause an error response to be generated
> > in ASP. You probably have ASP code which does ON ERROR RESUME NEXT,
> > which will skip over the error and show no error response because
> > that's what ON ERROR RESUME NEXT does.
>
> > I think you have a simple ACL problem that needs to be resolved. You
> > can check my blog for more assistance.
>
> > //David
> >http://w3-4u.blogspot.com
> >http://blogs.msdn.com/David.Wang
> > //
>
> > On Oct 14, 5:43 am, "Thanh-Nhan Le" wrote:
> >> Hi,
> >> I have an ASP application on IIS server:http://localhost/myApp
> >> I use ASP and a my own VB activex DLL to create a pdf file and write this
> >> file to a subfolder of the Application folder:http://localhost/myApp/pdfs
>
> >> 1-
> >> Over IIS I have set the "write permission" for this subfolder.
> >> But each time I receive the message: "Can't open output file (bad
> >> filename,
> >> in use by other application)", error 0x80040202
>
> >> 2- a visual basic test application can call this DLL, generate and write
> >> the
> >> file without problem to the folder
>
> >> 3- with ASP I generate the file in a normal folder (ie c:\temp), it works
> >> Then my ASP page use FileSystemObject to copy this file to the folder
> >> ..MyApp/pdfs
> >> When I call this page there is no error message, but the programm runs
> >> utils
> >> the line, where FileSystemObject to copy the file to the folder, then it
> >> stops there. The process is hung (dead). The file is not copied...
>
> >> How can I do?
>
> >> Thanks
> >> Nhan- Hide quoted text -
>
> - Show quoted text -