OnFileReceived not fired

Mar 6, 2009 at 5:59 AM
I am new to this control and find it very useful.

This control is working as desired on the developer machine.
But on deploying it on a shared server, it seems the event "OnFileReceived" is not fired, and thus the files are not uploaded.

We encountered no error while building or while uploading files on the deployment server.

Following is the code used.

ASPX
<%@ Page Language="VB" MasterPageFile="~/root/Backend.master" AutoEventWireup="false"
    CodeFile="UploadPhoto.aspx.vb" Inherits="userUpload_UploadPhoto" %>

<%@ Register TagPrefix="fjx" Namespace="com.flajaxian" Assembly="com.flajaxian.FileUploader" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table cellpadding="0" cellspacing="0" border="0" width="780">
        <tr>
            <td style="padding: 10px" height="300" valign="top">
                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                    <tr style="height: 20px; font-size: 18px; color: yellow">
                        <td class="title">
                            Upload Photo to gallery -
                            <%=GalleryName %>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 20px">
                            <asp:HiddenField ID="HdnGalId" runat="server" Value="0" />
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 15px">
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            <ol>
                                <li>Browse photo and activate "Upload" to upload image</li><%--<li>Activate
                                    "Clear" to remove all items from the list</li><li>Activate "Upload" to upload the images</li><li>
                                        To remove a single file activate "Delete" against the selected file</li>--%></ol>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="img" style="width: 80%" align="center">
                                <table cellpadding="0" cellspacing="2" border="0" width="100%">
                                    <tr>
                                        <td style="height: 10px">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <fjx:FileUploader ID="FileUploader1" RequestAsPostBack="true" runat="server" OnFileReceived="FileUploader1_FileReceived">
                                                
                                            </fjx:FileUploader>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="height: 15px">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Button ID="BtnComplete" runat="server" Text="complete" CssClass="greenButton" /></td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 10px">
                        </td>
                    </tr>
                    <tr>
                        <td valign="top">
                            <asp:Label ID="LblMsg" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="height: 50px">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>

CS
Protected Sub FileUploader1_FileReceived(ByVal sender As Object, ByVal e As com.flajaxian.FileReceivedEventArgs) Handles FileUploader1.FileReceived
        Try
            Dim fileName As String = CommonUtil.RNGCharacterMask()
            Dim fileExt As String = System.IO.Path.GetExtension(e.File.FileName)
            'hsImageIds.Add(fileName, fileExt)
            Dim imagePath As String = (Server.MapPath("../" & folderName) & "\") + fileName + fileExt
            e.File.SaveAs(imagePath)
            'Dim keywords As String = ""
            'Dim description As String = ""
            Dim imgSName As String = ""
            Dim imgMName As String = ""
            ResizeImage.UploadUserImage((Server.MapPath("../" & folderName) & "\") + fileName + fileExt, Server.MapPath("../" & folderName), fileName, imgSName, imgMName)
            DBUtility.InsertImageDetails(SProcConstants.INSERT_IMAGE_DETAILS, fileName, Session(_SriUser.uid + "_selectedGal").ToString(), "0", fileName + fileExt, imgSName, _
             imgMName, DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss"), "", "")
            Dim hsSize As New Hashtable()
            Dim query As String = "INSERT INTO imageResize_tbl (image_id,dimension,image_name) "
            ResizeImage.UploadTest((Server.MapPath("../" & folderName) & "\") + fileName + fileExt, Server.MapPath("../" & folderName), fileName, hsSize)
            Dim i As Integer = 0
            For Each ds As DictionaryEntry In hsSize
                i += 1
                If i <> hsSize.Count Then
                    query = (((query & "SELECT '") + fileName & "','") + ds.Key & "','") + ds.Value & "' UNION ALL  "
                Else
                    query = (((query & "SELECT '") + fileName & "','") + ds.Key & "','") + ds.Value & "'"
                End If
            Next
            DBUtility.DoAll(query)
        Catch ex As Exception
            Response.Write(ex.ToString())
        End Try
    End Sub
Coordinator
Mar 6, 2009 at 11:34 AM
Use Fiddler http://www.fiddlertool.com/Fiddler2/version.asp to determine if the request is executed
Mar 6, 2009 at 2:24 PM
I will need to learn how to operate the tool....

for which I dont have much time...

could you please let me know what could I check on the server or, any work around.

Thanks...
Coordinator
Mar 6, 2009 at 3:29 PM
Well, what makes you think I have time

And by the way if you are web developer you will need this tool regardless of weather you use Flajaxian Uploader.

There is not much to learn. If you use localhost do as described here: http://aspadvice.com/blogs/azamsharp/archive/2007/10/21/Using-Fiddler-With-localhost.aspx On the left side you have web sessions.  On the right side click on Inspector tab and then Raw sub tab. Top side is request bottom is response.
Mar 6, 2009 at 4:51 PM
I thought, you are the developer and can enlighten our poor souls 

Thanks