This forum is a community forum meant for users of the plugin to collaborate and help solve issues with implementation, etc. Unfortunately, as the creator of the plugin, I do not have much time to attend to every request here as this is only a side project and I must work a full-time job to provide for my family. This is how I keep the Flash version free and the HTML5 version low cost.
UploadiFive 1.1.1 has been released which includes a small fix for added support on touch devices including iOS 6 devices.
Error 500 while trying to implement uploadify
  • Hi everyone,

    Here is another epic fail while trying to implement uploadify using .NET. Basically, uploadify displays the HTTP error 500 and I don't know why.

    Here is my code:

    Defautl.aspx:

    In the head

    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script&gt;
    <script type="text/javascript" src="/uploadify/jquery.uploadify-3.1.js"></script>
    <script type = "text/javascript">
    $(function () {
    $('#<%=FileUpload1.ClientID %>').uploadify({
    'swf': 'uploadify/uploadify.swf',
    'uploader': 'uploadify/uploadify.ashx',
    'checkExisting': 'uploadify/check-exists.ashx',
    'fileObjName': 'Filedata',
    'debug': 'true',
    'folder': 'uploads',
    'onUploadStart': function (file) {
    alert('Starting to upload ' + file.name);
    },
    'onUploadProgress': function (file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {
    $('#progress').html(totalBytesUploaded + ' bytes uploaded of ' + totalBytesTotal + ' bytes.');
    },
    'onUploadError': function (file, errorCode, errorMsg, errorString) {
    alert('The file ' + file.name + ' could not be uploaded: ' + errorString + '.\nError Msg: ' + errorMsg);
    }
    // Put your options here
    });
    });
    </script>


    In the body

    <div id="progress"></div>
    <div>
    <asp:FileUpload ID="FileUpload1" runat="server" name="Filedata"/>
    </div>


    uploadify.ashx:


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.IO;
    using WebApplication.Sources.Log;

    namespace WebApplication.uploadify
    {
    /// <summary>
    /// Description résumée de uploader
    /// </summary>
    public class updloadify : IHttpHandler
    {
    private static readonly String className = "updloadify";
    private static readonly Logger log = LoggerManager.GetLogger(typeof(updloadify), className);

    public void ProcessRequest(HttpContext context)
    {
    context.Response.Write("1");
    }

    public bool IsReusable
    {
    get
    {
    return false;
    }
    }
    }
    }


    check-exists.ashx:


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;

    namespace WebApplication.uploadify
    {
    /// <summary>
    /// Description résumée de check_exists
    /// </summary>
    public class check_exists : IHttpHandler
    {

    public void ProcessRequest(HttpContext context)
    {
    context.Response.ContentType = "text/plain";
    context.Response.Write("0");
    }

    public bool IsReusable
    {
    get
    {
    return false;
    }
    }
    }
    }


    In the Web.config, I've put:


    <location path="uploadify/uploadify.ashx">
    <system.web>
    <authorization>
    <allow users="*"/>
    </authorization>
    </system.web>
    </location>


    Here is what I've observed:

    The function ProcessRequest, from check-exists.ashx is hit when I put a breakpoint.
    The function ProcessRequest ,from uploadify.ashx, is not hit when I put a breakpoint.

    Then, I decided to upload a very small picture of 44 661 bytes. The function called by the onUploadProgress event displayed 45175 bytes uploaded of 44661 bytes.

    Wtf???

    Where did it find 514 bytes?

    Yeah, okay, maybe the file is corrupted. So, I created a simple txt file with only character 't' inside and I tried to upload it.

    Here is the result: 415 bytes uploaded of 1 bytes.

    PS: I know that the check-exists.ashx and the uploadify.ashx scripts are not good and that it's normal if my file is not uploaded. But actually, I don't care about that. I just try to hit the breakpoint which is in uploadify.ashx.

    Can somebody tell me what I did wrong?

    Thanks
  • Here is the debug provided by the debug function of uploadify:

    ---SWFUpload Instance Info---
    Version: 2.2.0 2009-03-25
    Movie Name: SWFUpload_0
    Settings:
    upload_url: /uploadify/uploadify.ashx
    flash_url: uploadify/uploadify.swf?preventswfcaching=1344710695380
    use_query_string: false
    requeue_on_error: false
    http_success:
    assume_success_timeout: 30
    file_post_name: Filedata
    post_params: [object Object]
    file_types: *.*
    file_types_description: All Files
    file_size_limit: 0
    file_upload_limit: 0
    file_queue_limit: 999
    debug: true
    prevent_swf_caching: true
    button_placeholder_id: FileUpload1
    button_placeholder: Not Set
    button_image_url: /
    button_width: 120
    button_height: 30
    button_text:
    button_text_style: color: #000000; font-size: 16pt;
    button_text_top_padding: 0
    button_text_left_padding: 0
    button_action: -110
    button_disabled: false
    custom_settings: [object Object]
    Event Handlers:
    swfupload_loaded_handler assigned: false
    file_dialog_start_handler assigned: true
    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: /uploadify/uploadify.ashx
    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: 0 bytes
    SWF DEBUG: File Upload Limit: 0
    SWF DEBUG: File Queue Limit: 999
    SWF DEBUG: Post Params:
    SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
    SWF DEBUG:
    SWF DEBUG: Event: fileDialogStart : Browsing files. Multi 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
    SWF DEBUG: StartUpload: First file in queue
    SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
    SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /uploadify/uploadify.ashx 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: 45175. Total: 45175
    SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_0. HTTP Status: 500.
    SWF DEBUG: Event: uploadComplete : Upload cycle complete.
    SWF DEBUG: Event: AssumeSuccess: 30 passed without server response
    SWF DEBUG: Event: fileDialogStart : Browsing files. Multi 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_1
    SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
    SWF DEBUG: StartUpload: First file in queue
    SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_1
    SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /uploadify/uploadify.ashx for File ID: SWFUpload_0_1
    SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_1
    SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_1. Bytes: 415. Total: 415
    SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_1. HTTP Status: 500.
    SWF DEBUG: Event: uploadComplete : Upload cycle complete.
    SWF DEBUG: Event: AssumeSuccess: 30 passed without server response
    SWF DEBUG: Event: fileDialogStart : Browsing files. Multi 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_2
    SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
    SWF DEBUG: StartUpload: First file in queue
    SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_2
    SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /uploadify/uploadify.ashx for File ID: SWFUpload_0_2
    SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_2
    SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_2. Bytes: 45175. Total: 45175
    SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_2. HTTP Status: 500.
    SWF DEBUG: Event: uploadComplete : Upload cycle complete.