搜索

在本地可以正常上传图片

在线上项目上传图片就会出现 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
PHP的目的:构建动态网站PHP的目的:构建动态网站Apr 15, 2025 am 12:18 AM

PHP用于构建动态网站,其核心功能包括:1.生成动态内容,通过与数据库对接实时生成网页;2.处理用户交互和表单提交,验证输入并响应操作;3.管理会话和用户认证,提供个性化体验;4.优化性能和遵循最佳实践,提升网站效率和安全性。

PHP:处理数据库和服务器端逻辑PHP:处理数据库和服务器端逻辑Apr 15, 2025 am 12:15 AM

PHP在数据库操作和服务器端逻辑处理中使用MySQLi和PDO扩展进行数据库交互,并通过会话管理等功能处理服务器端逻辑。1)使用MySQLi或PDO连接数据库,执行SQL查询。2)通过会话管理等功能处理HTTP请求和用户状态。3)使用事务确保数据库操作的原子性。4)防止SQL注入,使用异常处理和关闭连接来调试。5)通过索引和缓存优化性能,编写可读性高的代码并进行错误处理。

您如何防止PHP中的SQL注入? (准备的陈述,PDO)您如何防止PHP中的SQL注入? (准备的陈述,PDO)Apr 15, 2025 am 12:15 AM

在PHP中使用预处理语句和PDO可以有效防范SQL注入攻击。1)使用PDO连接数据库并设置错误模式。2)通过prepare方法创建预处理语句,使用占位符和execute方法传递数据。3)处理查询结果并确保代码的安全性和性能。

PHP和Python:代码示例和比较PHP和Python:代码示例和比较Apr 15, 2025 am 12:07 AM

PHP和Python各有优劣,选择取决于项目需求和个人偏好。1.PHP适合快速开发和维护大型Web应用。2.Python在数据科学和机器学习领域占据主导地位。

PHP行动:现实世界中的示例和应用程序PHP行动:现实世界中的示例和应用程序Apr 14, 2025 am 12:19 AM

PHP在电子商务、内容管理系统和API开发中广泛应用。1)电子商务:用于购物车功能和支付处理。2)内容管理系统:用于动态内容生成和用户管理。3)API开发:用于RESTfulAPI开发和API安全性。通过性能优化和最佳实践,PHP应用的效率和可维护性得以提升。

PHP:轻松创建交互式Web内容PHP:轻松创建交互式Web内容Apr 14, 2025 am 12:15 AM

PHP可以轻松创建互动网页内容。1)通过嵌入HTML动态生成内容,根据用户输入或数据库数据实时展示。2)处理表单提交并生成动态输出,确保使用htmlspecialchars防XSS。3)结合MySQL创建用户注册系统,使用password_hash和预处理语句增强安全性。掌握这些技巧将提升Web开发效率。

PHP和Python:比较两种流行的编程语言PHP和Python:比较两种流行的编程语言Apr 14, 2025 am 12:13 AM

PHP和Python各有优势,选择依据项目需求。1.PHP适合web开发,尤其快速开发和维护网站。2.Python适用于数据科学、机器学习和人工智能,语法简洁,适合初学者。

PHP的持久相关性:它还活着吗?PHP的持久相关性:它还活着吗?Apr 14, 2025 am 12:12 AM

PHP仍然具有活力,其在现代编程领域中依然占据重要地位。1)PHP的简单易学和强大社区支持使其在Web开发中广泛应用;2)其灵活性和稳定性使其在处理Web表单、数据库操作和文件处理等方面表现出色;3)PHP不断进化和优化,适用于初学者和经验丰富的开发者。

See all articles

热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尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
1 个月前By尊渡假赌尊渡假赌尊渡假赌

热工具

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

Atom编辑器mac版下载

Atom编辑器mac版下载

最流行的的开源编辑器

VSCode Windows 64位 下载

VSCode Windows 64位 下载

微软推出的免费、功能强大的一款IDE编辑器

禅工作室 13.0.1

禅工作室 13.0.1

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

DVWA

DVWA

Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中