经典ASP- server.createobject-未经授权的操作

发布于 2025-02-04 12:51:19 字数 1159 浏览 1 评论 0原文

我有以下代码:

Set objUpload = Server.CreateObject("ASPUploadComponent.cUpload")   

它似乎是失败的,因为以下调试代码:

Response.Write(" begin ")
Response.Write(" Err : " & Err & " ")
Response.Write(" TypeName(Err) : " & TypeName(Err) & " ")
Response.Write(" Str(Err.Number): " & Err.Number & " ")
Response.Write(" Str(Err.Source): " & Err.Source & " ")
Response.Write(" Str(Err.Description): " & Err.Description & " ")
Response.Write(" TypeName(objUpload) : " & TypeName(objUpload) & " ")
Response.Write(" end ")

输出:

begin Err : -2147352567 TypeName(Err) : Object Str(Err.Number): -2147352567 Str(Err.Source): ASPUploadComponent Str(Err.Description): Unhandled error: 007~ASP 0104~Op�ration non autoris�e~ TypeName(objUpload) : Empty end 

未经授权的操作

创建对象的完全相同的方式在其他一些脚本上完美地工作,但在这里不行。

什么可能导致这个?

编辑

它不同于这个问题,因为您必须知道它与文件大小有关第一位。

I have the following code :

Set objUpload = Server.CreateObject("ASPUploadComponent.cUpload")   

It seems to be failing, because the following debug code :

Response.Write(" begin ")
Response.Write(" Err : " & Err & " ")
Response.Write(" TypeName(Err) : " & TypeName(Err) & " ")
Response.Write(" Str(Err.Number): " & Err.Number & " ")
Response.Write(" Str(Err.Source): " & Err.Source & " ")
Response.Write(" Str(Err.Description): " & Err.Description & " ")
Response.Write(" TypeName(objUpload) : " & TypeName(objUpload) & " ")
Response.Write(" end ")

Outputs :

begin Err : -2147352567 TypeName(Err) : Object Str(Err.Number): -2147352567 Str(Err.Source): ASPUploadComponent Str(Err.Description): Unhandled error: 007~ASP 0104~Op�ration non autoris�e~ TypeName(objUpload) : Empty end 

It says unauthorized operation.

This exact same way of creating the object works perfectly on some other script, but not here.

What could possibly cause this?

Edit

It's different from this question, because you would have to know it's related to the file size to begin with, so while the solution is the same, the other question would have not helped me, because I wouldn't have searched for it in the first place.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月静好 2025-02-11 12:51:19

因此,经过更多的挖掘,我找到了实际原因,这绝对不是直接的。

这是由于我试图上传的文件很小(1.27 MB)超过了IIS允许的Miaximum尺寸。而且,由于某种原因,我无法解释,而不是让我知道这是问题,而是com对象只会拒绝创建。

为了解决这个问题,必须更改IIS设置中的最大允许大小:

1):


是在法语中,但您会弄清楚。

So after more digging, I found the actual reason, and it's definately not straight forward.

It is due to the fact that the file I was trying to upload, despite being rather small (1.27 Mb) was exceeding the miaximum size allow by IIS. And, for some reason which I can't explain, instead of letting me know that this was the issue, the COM object would just refuse to be created.

To solve this, one must change the maximum allowed size in the IIS settings as follows :

1):
enter image description here

  1. :
    enter image description here

It's in french, but you'll figure out.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文