Accessing ChangedName Field

Aug 11, 2009 at 12:16 AM

I'm using the Direct Amazon Uploader, and when I change the name in 'FileNameDetermining' it works fine.

However, I then want to be able to save that name (key) within a database. When I create a ConfirmUpload (both server and javascript), neither the ChangedName nor the Path field have data. They are just blank.

Other than changing the name in the FileNameDetermining, is there something else to make this set?

    Public Sub FileUploader1_FileNameDetermining(ByVal sender As Object, ByVal e As FileNameDeterminingEventArgs)

        'First create a unique key to store 
        'this upload
        Dim tmpInt As Integer = RandomNumber(999999)

        'Save it to the templates key in AWS 
        e.FileName = "templates/" & tmpInt.ToString & "/" & e.FileName

    End Sub

    Public Sub FileUploader1_ConfirmUpload(ByVal sender As Object, ByVal e As ConfirmUploadEventArgs)

        'This is the confirm upload event.

        If e.IsError = False Then 'No error in upload
            Dim tmpExt As String
            tmpExt = System.IO.Path.GetExtension(e.Name)
            Dim strName As String
            strName = e.Name
            Dim strChangedName As String
            strChangedName = e.ChangedName 'This is blank/null - I can't get it to see the new name

    End Sub

Thank you for your help!

 

Coordinator
Aug 11, 2009 at 5:41 AM

FileName means just the name of the file not the path and the name.