目录
回复讨论(解决方案)
首页 后端开发 php教程 图片上传 401

图片上传 401

Jun 20, 2016 pm 12:40 PM

在本地可以正常上传图片

在线上项目上传图片就会出现 401,这是什么原因(代码跟本地的相同)


回复讨论(解决方案)

服务器是iis?

这个估计跟服务器的配置有关系

具体要截图,看看详细的信息。

401 是没有权限
你应给出具体的错误信息

抱歉,我没说清楚

线上项目
在火狐出现401

在谷歌正常



本地 火狐和谷歌都正常

抱歉,我没说清楚

线上项目
在火狐出现401

在谷歌正常



本地 火狐和谷歌都正常


贴个外网url吧

火狐

---SWFUpload Instance Info---Version: 2.2.0 2009-03-25Movie Name: SWFUpload_0Settings:	upload_url:               /lockton_corpweb/admin2s/index.php?r=bannerman/uploadAjax&id=	flash_url:                /lockton_corpweb/admin2s/assets/38f445df/swfupload.swf?preventswfcaching=1452650545444	use_query_string:         false	requeue_on_error:         false	http_success:             	assume_success_timeout:   0	file_post_name:           Filedata	post_params:              [object Object]	file_types:               *.jpg;*.jpeg;*.gif;*.png;	file_types_description:   *.jpg;*.jpeg;*.gif;*.png;文件	file_size_limit:          5MB	file_upload_limit:        0	file_queue_limit:         10	debug:                    true	prevent_swf_caching:      true	button_placeholder_id:    button_placeholder_1	button_placeholder:       Not Set	button_image_url:         /lockton_corpweb/admin2s/assets/38f445df/uploadbutton.gif	button_width:             186	button_height:            25	button_text:              <span class="button">Browse file<span class="buttonSmall">(5MB)</span></span>	button_text_style:        .button {font-family: Arial,Helvetica,sans-serif; font-size: 13pt; } .buttonSmall { font-size: 10pt; }	button_text_top_padding:  2	button_text_left_padding: 28	button_action:            -110	button_disabled:          false	custom_settings:          [object Object]Event Handlers:	swfupload_loaded_handler assigned:  false	file_dialog_start_handler assigned: false	file_queued_handler assigned:       false	file_queue_error_handler assigned:  true	upload_start_handler assigned:      false	upload_progress_handler assigned:   true	upload_error_handler assigned:      true	upload_success_handler assigned:    true	upload_complete_handler assigned:   true	debug_handler assigned:             trueSWF DEBUG: SWFUpload Init CompleteSWF DEBUG: SWF DEBUG: ----- SWF DEBUG OUTPUT ----SWF DEBUG: Build Number:           SWFUPLOAD 2.2.0SWF DEBUG: movieName:              SWFUpload_0SWF DEBUG: Upload URL:             /lockton_corpweb/admin2s/index.php?r=bannerman/uploadAjax&id=SWF DEBUG: File Types String:      *.jpg;*.jpeg;*.gif;*.png;SWF DEBUG: Parsed File Types:      jpg,jpeg,gif,png,SWF DEBUG: HTTP Success:           0SWF DEBUG: File Types Description: *.jpg;*.jpeg;*.gif;*.png;文件 (*.jpg;*.jpeg;*.gif;*.png;)SWF DEBUG: File Size Limit:        5242880 bytesSWF DEBUG: File Upload Limit:      0SWF DEBUG: File Queue Limit:       10SWF DEBUG: Post Params:SWF DEBUG:                         fileQuenueLimit=10SWF DEBUG:                         SessionID=u9fu4i7jr91k7lgl1o6b4jrgd3SWF DEBUG:                         SWFUpload=1SWF DEBUG:                         callbackJS=bannerman_enimage_upload_callbackSWF DEBUG: ----- END SWF DEBUG OUTPUT ----SWF DEBUG: SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.jpg;*.jpeg;*.gif;*.png;SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1SWF DEBUG: StartUpload: First file in queueSWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0SWF DEBUG: Global Post Item: fileQuenueLimit=10SWF DEBUG: Global Post Item: SessionID=u9fu4i7jr91k7lgl1o6b4jrgd3SWF DEBUG: Global Post Item: SWFUpload=1SWF DEBUG: Global Post Item: callbackJS=bannerman_enimage_upload_callbackSWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to /lockton_corpweb/admin2s/index.php?r=bannerman/uploadAjax&id= for File ID: SWFUpload_0_0SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 7108. Total: 7108SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_0. HTTP Status: 401.SWF DEBUG: Event: uploadComplete : Upload cycle complete.EXCEPTION: 
登录后复制

谷歌

---SWFUpload Instance Info---Version: 2.2.0 2009-03-25Movie Name: SWFUpload_0Settings:	upload_url:               /lockton_corpweb/admin2s/index.php?r=bannerman/uploadAjax&id=	flash_url:                /lockton_corpweb/admin2s/assets/38f445df/swfupload.swf?preventswfcaching=1452650521992	use_query_string:         false	requeue_on_error:         false	http_success:             	assume_success_timeout:   0	file_post_name:           Filedata	post_params:              [object Object]	file_types:               *.jpg;*.jpeg;*.gif;*.png;	file_types_description:   *.jpg;*.jpeg;*.gif;*.png;文件	file_size_limit:          5MB	file_upload_limit:        0	file_queue_limit:         10	debug:                    true	prevent_swf_caching:      true	button_placeholder_id:    button_placeholder_1	button_placeholder:       Not Set	button_image_url:         /lockton_corpweb/admin2s/assets/38f445df/uploadbutton.gif	button_width:             186	button_height:            25	button_text:              <span class="button">Browse file<span class="buttonSmall">(5MB)</span></span>	button_text_style:        .button {font-family: Arial,Helvetica,sans-serif; font-size: 13pt; } .buttonSmall { font-size: 10pt; }	button_text_top_padding:  2	button_text_left_padding: 28	button_action:            -110	button_disabled:          false	custom_settings:          [object Object]Event Handlers:	swfupload_loaded_handler assigned:  false	file_dialog_start_handler assigned: false	file_queued_handler assigned:       false	file_queue_error_handler assigned:  true	upload_start_handler assigned:      false	upload_progress_handler assigned:   true	upload_error_handler assigned:      true	upload_success_handler assigned:    true	upload_complete_handler assigned:   true	debug_handler assigned:             trueSWF DEBUG: SWFUpload Init CompleteSWF DEBUG: SWF DEBUG: ----- SWF DEBUG OUTPUT ----SWF DEBUG: Build Number:           SWFUPLOAD 2.2.0SWF DEBUG: movieName:              SWFUpload_0SWF DEBUG: Upload URL:             /lockton_corpweb/admin2s/index.php?r=bannerman/uploadAjax&id=SWF DEBUG: File Types String:      *.jpg;*.jpeg;*.gif;*.png;SWF DEBUG: Parsed File Types:      jpg,jpeg,gif,png,SWF DEBUG: HTTP Success:           0SWF DEBUG: File Types Description: *.jpg;*.jpeg;*.gif;*.png;文件 (*.jpg;*.jpeg;*.gif;*.png;)SWF DEBUG: File Size Limit:        5242880 bytesSWF DEBUG: File Upload Limit:      0SWF DEBUG: File Queue Limit:       10SWF DEBUG: Post Params:SWF DEBUG:                         SWFUpload=1SWF DEBUG:                         callbackJS=bannerman_enimage_upload_callbackSWF DEBUG:                         fileQuenueLimit=10SWF DEBUG:                         SessionID=qu71ijsksi8kvvdqudqo5crc86SWF DEBUG: ----- END SWF DEBUG OUTPUT ----SWF DEBUG: SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.jpg;*.jpeg;*.gif;*.png;SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1SWF DEBUG: StartUpload: First file in queueSWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0SWF DEBUG: Global Post Item: SWFUpload=1SWF DEBUG: Global Post Item: callbackJS=bannerman_enimage_upload_callbackSWF DEBUG: Global Post Item: fileQuenueLimit=10SWF DEBUG: Global Post Item: SessionID=qu71ijsksi8kvvdqudqo5crc86SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to /lockton_corpweb/admin2s/index.php?r=bannerman/uploadAjax&id= for File ID: SWFUpload_0_0SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 1530. Total: 1530SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Response Received: true Data: JS:(bannerman_enimage_upload_callback)('20160113100115.0.png','/var/www/html/lockton_corpweb/admin2s/protected/../../materials/bannerman','secondarytile.png');SWF DEBUG: Event: uploadComplete : Upload cycle complete.
登录后复制

这是你自己的上传代码里自定义的401,你得看代码去,看为什么给这个。
不过,我猜测是文件夹的写入权限问题。

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.聊天命令以及如何使用它们
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

在PHP API中说明JSON Web令牌(JWT)及其用例。 在PHP API中说明JSON Web令牌(JWT)及其用例。 Apr 05, 2025 am 12:04 AM

JWT是一种基于JSON的开放标准,用于在各方之间安全地传输信息,主要用于身份验证和信息交换。1.JWT由Header、Payload和Signature三部分组成。2.JWT的工作原理包括生成JWT、验证JWT和解析Payload三个步骤。3.在PHP中使用JWT进行身份验证时,可以生成和验证JWT,并在高级用法中包含用户角色和权限信息。4.常见错误包括签名验证失败、令牌过期和Payload过大,调试技巧包括使用调试工具和日志记录。5.性能优化和最佳实践包括使用合适的签名算法、合理设置有效期、

解释PHP中晚期静态结合的概念。 解释PHP中晚期静态结合的概念。 Mar 21, 2025 pm 01:33 PM

文章讨论了PHP 5.3中引入的PHP中的晚期静态结合(LSB),从而允许静态方法的运行时分辨率调用以获得更灵活的继承。 LSB的实用应用和潜在的触摸

框架安全功能:防止漏洞。 框架安全功能:防止漏洞。 Mar 28, 2025 pm 05:11 PM

文章讨论了框架中的基本安全功能,以防止漏洞,包括输入验证,身份验证和常规更新。

如何用PHP的cURL库发送包含JSON数据的POST请求? 如何用PHP的cURL库发送包含JSON数据的POST请求? Apr 01, 2025 pm 03:12 PM

使用PHP的cURL库发送JSON数据在PHP开发中,经常需要与外部API进行交互,其中一种常见的方式是使用cURL库发送POST�...

自定义/扩展框架:如何添加自定义功能。 自定义/扩展框架:如何添加自定义功能。 Mar 28, 2025 pm 05:12 PM

本文讨论了将自定义功能添加到框架上,专注于理解体系结构,识别扩展点以及集成和调试的最佳实践。

描述扎实的原则及其如何应用于PHP的开发。 描述扎实的原则及其如何应用于PHP的开发。 Apr 03, 2025 am 12:04 AM

SOLID原则在PHP开发中的应用包括:1.单一职责原则(SRP):每个类只负责一个功能。2.开闭原则(OCP):通过扩展而非修改实现变化。3.里氏替换原则(LSP):子类可替换基类而不影响程序正确性。4.接口隔离原则(ISP):使用细粒度接口避免依赖不使用的方法。5.依赖倒置原则(DIP):高低层次模块都依赖于抽象,通过依赖注入实现。

会话如何劫持工作,如何在PHP中减轻它? 会话如何劫持工作,如何在PHP中减轻它? Apr 06, 2025 am 12:02 AM

会话劫持可以通过以下步骤实现:1.获取会话ID,2.使用会话ID,3.保持会话活跃。在PHP中防范会话劫持的方法包括:1.使用session_regenerate_id()函数重新生成会话ID,2.通过数据库存储会话数据,3.确保所有会话数据通过HTTPS传输。

See all articles