Upload to different folder

Jun 28, 2011 at 4:22 PM

I am needing to upload to a specific folder onto another server.

The directory would be: \\FileServer\upload\~User~

~User~ directory is created upon the user logging in should they not have a directory created previously.


The markup I'm using is as follows:

<fjx:FileUploader ID="FileUploader1" runat="server" onFileReceived="FileUploader_FileReceived"></fjx:FileUploader>

The codebehind is as follows:

    Protected Sub FileUploader_FileReceived(ByVal sender As Object, ByVal e As FileReceivedEventArgs)
        Dim bu As BaseUser = CType(Session("currentUser"), BaseUser)
        Dim savePath As String = "\\FileServer\upload\"

        e.File.SaveAs(savePath & bu.email.ToString())

    End Sub

However, currently, FileUploader_FileReceived is not executing when a file is uploaded. Testing purposes have utilized .jpg & .png files.

Any thoughts on how to correct this problem? Thanks in advance!

Jun 29, 2011 at 5:40 AM


I didn't do a postback. My code should have been:


<fjx:FileUploader ID="FileUploader1" RequestAsPostBack="true" UseInsideUpdatePanel="false" runat="server" OnFileReceived="FileUploader_FileReceived" MaxFileQueueSize="1MB"></fjx:FileUploader>