OnFileNameDetermining doesn't works

Mar 6, 2010 at 3:44 AM
Edited Mar 6, 2010 at 3:48 AM

Hi,

First of all i want to congrats your team for that great object.

I read all of this discussion site and I can't find what I missing on the code. The is that onfiledetermining doesn't works.

If I not use this call, the object upload the files correctly, but if I put the call to my function none files will be uploaded. My code is bellow:

<script runat="server">
   Protected Sub File(ByVal sender As EventArgs, ByVal args As com.flajaxian.FileNameDeterminingEventArgs)
      args.FileName = "test.jpg"
   End Sub
</script>

<fjx:FileUploader ID="FU" runat="server">
  <Adapters>
    <fjx:FileSaverAdapter FolderName="imgs/" OnFileNameDetermining="File" />
  </Adapters>
</fjx:FileUploader>

 

Thank you very much,

 

Ricardo

Mar 6, 2010 at 7:01 PM

OK.

I found the problem. I download the source code and debung the code. So I found a issue, when I use the FileDetermining I need to pass the complete folder.

 

So if I build my sub like above, my code works:

<script runat="server">
   Protected Sub File(ByVal sender As EventArgs, ByVal args As com.flajaxian.FileNameDeterminingEventArgs)
      args.FileName = server.mappath("~/imgs/") & "test.jpg"
   End Sub
</script>

<fjx:FileUploader ID="FU" runat="server">
  <Adapters>
    <fjx:FileSaverAdapter FolderName="imgs/" OnFileNameDetermining="File" />
  </Adapters>
</fjx:FileUploader>

 

Again, that is the best file upload control ever.

Thanks,

 

Ricardo