?
Solved

"Operation not Allowed" error for a Request object

Posted on 2005-04-07
24
Medium Priority
?
4,203 Views
Last Modified: 2007-12-19
I am getting this error...

Request object error 'ASP 0104 : 80004005'

Operation not Allowed

...for this code here:

Response.Expires=0
Response.Buffer = TRUE
Response.Clear

byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)

Can anyone see something wrong???

0
Comment
Question by:HangTenDesign
  • 11
  • 9
  • 2
  • +2
24 Comments
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13728860
and there is nothing else in the code?
0
 
LVL 6

Expert Comment

by:infex
ID: 13728951
You are not allowed to do a request.BinaryRead after a request.form, a request.querystring or most other kinds of requests.
0
 

Author Comment

by:HangTenDesign
ID: 13729033
ThaSmartUno,

Here is the rest of the code up until where the error occurs:

-------------------------------------------

<%@ Language="VBScript"  %>
<% Response.buffer = true %>
<html>
<head>
      <title>Title</title>
</head>

<body>

<%
file = session("file")
Response.write(file)
Response.Expires=0
Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes

RequestBin = Request.BinaryRead(byteCount)

-------------------------------------------
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729047
I cannot recreate the error with that, so I'm not quite sure that I could help you
0
 

Author Comment

by:HangTenDesign
ID: 13729060
infex,

There are no other request object calls other than the Request.TotalBytes and that was an example used on MSDN.

from:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iissdk/html/c84b1f88-1a8a-4370-95de-e907f7fdd5e7.asp

shows example:

<%
  Dim vntPostedData, lngCount
  lngCount = Request.TotalBytes
  vntPostedData = Request.BinaryRead(lngCount)
%>
0
 

Author Comment

by:HangTenDesign
ID: 13729092
ThaSmartUno,

Right and I may not be able to help you there since the Request.BinaryRead method requires data submitted to it as POST.

Is it possible that the Response.Clear is clearing the posted data so that the Request.BinaryRead is reading 0 bytes???
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729173
no ... i used this example and it works fine ... (named test.asp)

<%
Response.Expires=0
Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)
Response.BinaryWrite RequestBin
%>

<form action="test.asp" method="post" enctype="multipart/form-data">
<input type="hidden" name="a" value="s" />
<input type="submit" name="s" value="s" />
</form>
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729184
well not necessarily no ... but change no to "i dont think so"  =)
0
 

Author Comment

by:HangTenDesign
ID: 13729323
ThaSmartUno,

Right, I agree cause Clearing the Response would not clear the Request.

What would cause Operation not Allowed??? Could it be an IIS setting of some kind???
0
 

Author Comment

by:HangTenDesign
ID: 13729361
Can you run your test with this included??? These lines were included in the second code I posted for you.


...

file = "Name of File" 'try this
Response.write(file) 'try this

Response.Expires=0
Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)
Response.BinaryWrite RequestBin

...
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729375
(seems to be having a db error right now)
http://www.duresources.com/forums/detail.asp?iMsg=2111&iCat=19&nCat=ASP

came from this link (loads very slow some blog site)
http://www.peorth.com.ar/blog/index.php/archivos/2004/04/11/operation-not-allowed/

has steps to tell you exactly, as long as you are uploading a file that is > 200k or so
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729379
and it still works for me
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729481
http://www.2rss.com/blog/2003_12_01_archive.html#107030484541784313

has a script to change it if you cannot find the file (which on xp pro i could not find it)
0
 
LVL 15

Expert Comment

by:joeposter649
ID: 13729762
I don't follow all the other posts here but it seems to me you can't have the second "Response.Buffer = TRUE".  The Buffer property cannot be set or changed after the server has sent output to the browser.
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729779
it doesnt show an error though =(
0
 

Author Comment

by:HangTenDesign
ID: 13729931
ThaSmartUno,

It's interesting that you said you cannot find the file on XP pro. This very same code is working fine on NT4. We are, however, migrating the site to 2003 and it's not working there. Same code with nothing changed.
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13729949
I'm also migrating to 2003 server in about a week, so I will probably experience the same problem, so I hope you/we can find a solution
0
 
LVL 18

Expert Comment

by:SquareHead
ID: 13733504
"The Buffer property cannot be set after the server has sent output to the client. For this reason, the call to Response.Buffer should be the first line of the .asp file."

0
 

Author Comment

by:HangTenDesign
ID: 13772355
SquareHead, I removed the second Response.Buffer = TRUE and it's still not working. (This exact code is working on our NT4 server)
Could there be an issue with Server 2003 and the use of Request.BinaryRead?
0
 

Author Comment

by:HangTenDesign
ID: 13773410
OK THE PROBLEM HAS BEEN FIXED.

I got this from an online source:

IIS6.0 prevents the upload of files more than +200Kb. So you need to make some changes in the default IIS settings first.

Background
For IIS6.0 users, the AspMaxRequestEntityAllowed property specifies the maximum number of bytes allowed in the entity body of an ASP request. If a Content-Length header is present and specifies an amount of data greater than the value of AspMaxRequestEntityAllowed, IIS returns a 403 error response.

This property is related in function to MaxRequestEntityAllowed, but is specific to ASP request. Whereas you might set the MaxRequestEntityAllowed property to 1 MB at the general World Wide Web Publishing Service (WWW Service) level, you may choose to set AspMaxRequestEntityAllowed to a lower value, if you know that your specific ASP applications handle a smaller amount of data.

Solution
Open your metabase.XML which is located in c:\Windows\System32\Inetsrv find the line "AspMaxRequestEntityAllowed" and change it to "1073741824". This is 1GB - of course you can enter another value to suite your needs.

----IMPORTANT----
Before you edit the file, be sure to stop the IIS service first or else you won't be able to save the file. HOWEVER, you can go to the properties of the IIS server, check on "Enable Direct Metabase Edit" and this would allow you to change the IIS metabase.xml file on the fly.

0
 
LVL 10

Accepted Solution

by:
ThaSmartUno earned 1600 total points
ID: 13773903
HangTenDesign  my answer at http:#13729481 shows that (so is that what worked for you?)
0
 

Author Comment

by:HangTenDesign
ID: 13775072
You're totally right. I can't believe I overlooked that. Thanks ThaSmartUno!
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13775272
you're welcome glad to know it will be something easy to do once I upgrade also =)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Screencast - Getting to Know the Pipeline
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question