DirectAmazonUploader and FileStateChanged Issue

Aug 8, 2009 at 6:11 PM


I'm having an issue with manually changing the StatusCode in FileNameDeterming function and then displaying an error to the user. My code is

<fjx:FileUploader ID="AmazonUploadFileUploader" runat="server" ForeColor="Black" JsFunc_PositionFilesList="PositionFilesListFunc"
                        MaxFileSize="100MB" MaxFileSizeReachedMessage="Files must be smaller than {0} to upload."
                        MaxFileQueueSize="200MB" MaxFileQueueSizeReachedMessage="All the files can not be bigger than {0}."
                        JsFunc_FileStateChanged="FileStateChanged" IsDebug="true"

--- Code Behind --

Protected Sub AmazonUploadFileUploader_FileNameDetermining(ByVal sender As Object, ByVal e As FileNameDeterminingEventArgs)

       e.CancelProcessing = True
        HttpContext.Current.Response.StatusCode = 550
    End Sub

--Java Script ---

function FileStateChanged(uploader, file, httpStatus, isLast){

    Flajaxian.fileStateChanged(uploader, file, httpStatus, isLast);
    if(httpStatus > 0)


If i comment out the logic in the FileNameDetermining function, and upload a file, it alerts the correct status code (200 - saying it is OK).  Then when I uncomment the logic and try to upload the file, nothing happens and the file never gets uploaded and nothing is ever displayed.  There are no javascript errors on the browser.

I want to do this because I want to insert the filename into a database with other information, and if there is an error inserting, i want to throw an error, cancel the upload and display a message the user.  This seems like the ideal way to accomplish my task but can't seem to get it working.

any help would be appreciated.

Aug 17, 2009 at 12:15 AM

anybody have any ideas for this....???