Upload Button Not working in firefox 2.0

Last post 12-26-2008, 3:38 PM by cutechat. 5 replies.
Sort Posts: Previous Next
  •  12-25-2008, 10:24 PM 47219

    Upload Button Not working in firefox 2.0

    I tried to implement ajax uploader's simple upload with progress (custom validation) in my project.
    the files are uploaded fine in IE7 and firefox 3.0.
     
    but the upload button is disabled in firefox 2.0.
    i also tried by changing the upload method to iframe.
    the iframe method again works fine in IE7 and firefox 3.0 .
     
    In firefox 2.0 the upload button is activated in iframe upload mode,
    but is giving "invalid postback or callout argument error message" when the upload file button is clicked.
     
    Moreover the uploaded files are renamed with .resx extension added at the end of the filename.
    Eg:
    1111.swf converts to
    persisted..................................1111.swf.resx
     
    Is there any inbuilt functionality in the uploader component which uploads the file in original extension and name?
     
    Thanks.
    Filed under:
  •  12-26-2008, 12:30 AM 47221 in reply to 47219

    Re: Upload Button Not working in firefox 2.0

    Hi,
     
    Can you test this online sample http://ajaxuploader.com/demo/fulltest.aspx ?
     
    The uploader would added .resx to prevent the file be downloaded or executed by implicit permissions.
     
    When you use the Uploader , you need use the properties/methods of the UploaderEventArgs (FileName/CopyTo etc..) to process the uploaded data. for example:
     
     void Uploader_FileUploaded(object sender, UploaderEventArgs args)
     {
      string folder = Server.MapPath("~/MyFiles");
      string savepath = System.IO.Path.Combine(folder, args.FileName);
      args.MoveTo(savepath);
     }
     
    Regards,
    Terry
  •  12-26-2008, 2:25 AM 47223 in reply to 47221

    Re: Upload Button Not working in firefox 2.0

    hey, thanks for your instant reply.
     
    we intend to use your control in a video website for uploading the videos. After uploading the video to a folder, we have to pass on the video to another 3rd party component media handler pro which will convert the uploaded file to flv format and stored that video at destination folder.
     
    so my question is that how we can rename the video while uploading through your component and then pass valid filename to another 3rd party component as the component accepts valid filename.
     
    Whats the method / function which we can use to rename the file after its successfully uploaded and then pass on this renamed file to another component for conversion to flv format.
     
    eg:
     i upload a file named c001.avi through your component.
    it is uploaded into a folder named uploadedTemp with name persisted.....c001.avi.resx
     
    at this point i want to rename the uploaded file into a valid file name say somerandomname.avi (using random function).
     
    hows that possible.
     
    i can see that if we move the file, the file becomes the actual file upload. i.e it automatically converts / renames itself to the actual file uploaded.
     
    how can we do the same without moving the file, but in addition to that we want to have our own file name instead of the original file name uploaded.
     
    Waiting for your reply.
     
     
    Regards.
  •  12-26-2008, 10:16 AM 47226 in reply to 47223

    Re: Upload Button Not working in firefox 2.0

    Hi
     
    You must move the file before processing it.
     
    And moving the file, is not a problem, I think.
     
     void Uploader_FileUploaded(object sender, UploaderEventArgs args)
     {
      string folder = Server.MapPath("~/MyFiles");
      string savepath = System.IO.Path.Combine(folder, args.FileName);
      args.MoveTo(savepath);
      //because the args.FileName is the origin name, so now it has the origin file extension
      //now you can convert the file :
      MyApp.ConvertAVI(savepath);
      //or you can also put it into queue,and convert it later at background(so the client can know the file have been uploaded and do not need wait conversation.)
      //MyApp.AddFileIntoQueue(savepath);
     }
     
     
    Regards,
    Terry
  •  12-26-2008, 2:09 PM 47230 in reply to 47226

    Re: Upload Button Not working in firefox 2.0

    hi,
     
    Thanks for your reply.
     
    I wanted to know that how can i rename the uploaded file say (abc.mov) using the  ButtonPostBack_Click event.
    ie when i click the postback button, then the uploaded file should be renamed and then moved to another folder using the postbutton click.

    Is there any specific function for renaming the file using the uploader component ( like the args.MoveTo() function is for moving the file).
     
    Thanks.
  •  12-26-2008, 3:38 PM 47232 in reply to 47230

    Re: Upload Button Not working in firefox 2.0

    Hi,
     
    You can try the UploadPersistedFile or UploadAttachments .
     
    They can help you hode the file temporary, and then you can use it in other events.
     
    for example , you put an UploadPersistedFile object ID=UploadPersistedFile1 :
     
    void Button_Click(...)
    {
        //if do not have uploaded a file
        if(UploadPersistedFile1.File==null)return;
     
        string folder = Server.MapPath("~/MyFiles");
        string savepath = System.IO.Path.Combine(folder, UploadPersistedFile1.File.FileName);
        UploadPersistedFile1.File.MoveTo(savepath);
        ProcessFlvFile(savepath);
    }
     
    Regards,
    Terry
     
View as RSS news feed in XML