1

我有一个继承的项目,它使用代码点火器、prototype.js 和 swfUpload 来管理大型视频文件。我遇到了上传大型视频文件时窒息的问题。

我已成功上传较小的文件(~198mb mpg 文件和 3mb mov 文件),但在调试上传 1.57 GB mov 文件时遇到问题。

在我的本地机器上,上传在约 1 分钟内完成上传,成功返回。但是,当我转到文件应该存在的上传文件夹(以及成功上传较小文件的位置)时,它就丢失了。

我的错误日志中没有错误。

在我的 .htaccess 文件中,我正在设置:

php_value upload_max_filesize 6143M  
php_value post_max_size 6143M  

我通过调用 ini_get() 确认这是有效的

这是我的 SWFUpload 对象:

swfu = new SWFUpload({
   debug: true,
   upload_url: '" . BASE_URL . "/content_management/ajax_asset_upload_files',
   flash_url: '" . BASE_URL . "/js/swfupload/Flash/swfupload.swf',

   post_params: {'PHPSESSID' : '" . $this->session->userdata('session_id') . "'},
   file_size_limit : '10000 MB',
   file_types : '*.*',
   file_types_description : 'All Files',
   file_upload_limit : 100,
   file_queue_limit : 0,
   custom_settings : {
      progressTarget : 'fsUploadProgress'
   },

   // Button settings
   button_image_url: '" . BASE_URL . "/images/buttons/btn_select_file.gif',
   button_width: '105',
   button_window_mode: 'transparent',
   button_height: '20',
   button_placeholder_id: 'spanButtonPlaceHolder',
   button_disabled: true,
   button_cursor: SWFUpload.CURSOR.HAND,
   button_action: SWFUpload.BUTTON_ACTION.SELECT_FILE,

   // The event handler functions are defined in handlers.js
   file_queued_handler : fileQueued,
   file_queue_error_handler : fileQueueError,
   file_dialog_complete_handler : fileDialogComplete,
   upload_start_handler : uploadStart,
   upload_progress_handler : uploadProgress,
   upload_error_handler : uploadError,
   upload_success_handler : assetUploadSuccess,
   upload_complete_handler : uploadComplete,
   queue_complete_handler : queueComplete // Queue plugin event
});

和调试输出:

---SWFUpload Instance Info---
Version: 2.2.0 2009-03-25
Movie Name: SWFUpload_0
Settings:
   upload_url:               [function location]
   flash_url:                [js_folder]/swfupload.swf?preventswfcaching=1363621116581
   use_query_string:         false
   requeue_on_error:         false
   http_success:             
   assume_success_timeout:   0
   file_post_name:           Filedata
   post_params:              [object Object]
   file_types:               *.*
   file_types_description:   All Files
   file_size_limit:          10000 MB
   file_upload_limit:        100
   file_queue_limit:         0
   debug:                    true
   prevent_swf_caching:      true
   button_placeholder_id:    spanButtonPlaceHolder
   ...
Event Handlers:
   swfupload_loaded_handler assigned:  false
   file_dialog_start_handler assigned: false
   file_queued_handler assigned:       true
   file_queue_error_handler assigned:  true
   upload_start_handler assigned:      true
   upload_progress_handler assigned:   true
   upload_error_handler assigned:      true
   upload_success_handler assigned:    true
   upload_complete_handler assigned:   true
   debug_handler assigned:             true

SWF DEBUG: SWFUpload Init Complete
SWF DEBUG: 
SWF DEBUG: ----- SWF DEBUG OUTPUT ----
SWF DEBUG: Build Number:           SWFUPLOAD 2.2.0
SWF DEBUG: movieName:              SWFUpload_0
SWF DEBUG: Upload URL:             [function location]
SWF DEBUG: File Types String:      *.*
SWF DEBUG: Parsed File Types:      
SWF DEBUG: HTTP Success:           0
SWF DEBUG: File Types Description: All Files (*.*)
SWF DEBUG: File Size Limit:        10485760000 bytes
SWF DEBUG: File Upload Limit:      100
SWF DEBUG: File Queue Limit:       100
SWF DEBUG: Post Params:
SWF DEBUG:                         PHPSESSID=ki7kne5j6co95il6f6hqt8pje4
SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
SWF DEBUG: 
SWF DEBUG: Event: fileDialogStart : Browsing files. Single Select. Allowed file types: *.*
SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
EXCEPTION: 
SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
SWF DEBUG: Global Post Item: PHPSESSID=ki7kne5j6co95il6f6hqt8pje4
SWF DEBUG: File Post Item: asset_id=131
SWF DEBUG: File Post Item: document_type_id=4
SWF DEBUG: File Post Item: title_id=-1
SWF DEBUG: File Post Item: title=test3
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to [upload function] for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 1409024. Total: 1692228612
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 5308416. Total: 1692228612
...
...
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 1692228612. Total: 1692228612
SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Response Received: true Data: 
SWF DEBUG: Event: uploadComplete : Upload cycle complete.

提前致谢。

4

1 回答 1

0

您的主机可能已禁用您对 set_time_limit(0) 等 php 变量进行 ini_set 以增加最大执行时间的功能,在这种情况下,它将使用 Apache 在 httpd.conf 中的“超时”,默认为 60 秒。还设置FcgidMaxRequestLen,即最大请求长度(以字节为单位)。

在 php 中,还要检查:memory_limit

为了帮助您调试,还可以尝试: ini_set('display_errors','On'); 错误报告(E_ALL);

也从您的代码中删除任何 at 符号。例如:@$varname 或 @functionName() @ 告诉 PHP 隐藏正在发生的任何错误。

可能是您的 error_reporting 级别设置得太低,因此实际上存在错误,但您没有看到它。以上应该解决这个问题。

于 2013-03-19T17:18:49.023 回答