OnFileNameDetermining is not fired

Jul 30, 2009 at 1:50 PM
Edited Jul 30, 2009 at 2:41 PM


I don't know why the event is not fired :


   25  <script runat="server">


   27       Protected Sub FileNameDetermining(ByVal sender As Object, ByVal args As FileNameDeterminingEventArgs)

   28         Dim name As String = "image.jpeg"


   30       End Sub

   31     </script>

   58  <fjx:FileUploader runat="server" ID="FileUplader1"

   59           MaxFileSize="10MB"

   60           MaxFileSizeReachedMessage="No files bigger than {0} are allowed"

   61           MaxNumberFiles="1"

   62           MaxFileNumberReachedMessage="You can select only upload {0} file at a time"

   63           Width="400"

   64           Height="50"   

   65           BrowseButtonUrl="Images/browse0_normal.gif"

   66           BrowseButtonOverUrl="Images/browse0_over.gif"

   67           BrowseButtonPressedUrl="Images/browse0_click.gif"

   68           BrowseButtonX="0"

   69           BrowseButtonY="15"

   70           BrowseButtonWidth="20"

   71           BrowseButtonHeight="10"

   72           JsFunc_FileStateChanged="FileStateChanged"

   73           OnFileNameDetermining="FileNameDetermining"

   74           >

   75           <Adapters>

   76             <fjx:FileSaverAdapter runat="server"  />

   77             <fjx:ThumbGeneratorAdapter Runat="server"

   78               Extensions="jpg;jpeg" FolderName="UploadFolder"

   79               Suffix="_thumb" MaximumWidth="200" MaximumHeight="200" />

   80           </Adapters>       

   81         </fjx:FileUploader>

Any idea ?


Jul 30, 2009 at 2:37 PM

Because this event is fired by the adapter not by the control.

Just look at the examples of the help file http://www.flajaxian.com/flajaxian.com/FileUploader2.0Help.html#HowToNotifyUser

Jul 30, 2009 at 2:43 PM

ha yes you are right. Thank you.


Is there any way I can rename the file before it is uploaded ? With this event I can only do it after the upload...

Jul 30, 2009 at 2:56 PM

Nope you do it before the upload. File will never be stored on the server with the original name if that's your concern.

Jul 30, 2009 at 3:20 PM

Ok, it works. I wanted to rename the file on the server indeed.

One issue though : I'm generating thumbnails on the client side using your control. However how can I rename the thumbnail as well ? Maybe I should create the thumbnail on the server instead, might be easier...

Aug 5, 2009 at 3:32 PM


I am looking for the same solution, how to rename the file on the server before it gets uploaded.
Can somebody show me please how I can do this? I am still learning .NET and cannot figure it out. I guess I have to write some code in the "FileNameDetermining" method. Is that right?

Thank you very much.