Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
sancad63  
#1 Posted : Wednesday, August 17, 2011 12:32:31 PM(UTC)
sancad63

Rank: Member

Groups: Member
Joined: 3/4/2009(UTC)
Posts: 11

I am using ASP.net and programing in visual basic. I can get the Autosave method to work however, I can not seem to get the FileUploaded/AllFileUploaded Controls to work.
My code is as follows:

<cc1:Uploader id="Uploader1" OnFileUploaded="Uploader1_FileUploaded" OnAllFilesUploaded="Uploader1_AllFilesUploaded" Type="java" runat="server" AutoSave="false" TempDirectory="./DigitalFiles/_thumbnail" DestinationFolder="./DigitalFiles" LicenseKey="XXXX-XXXX-XXXX-XXXX-XXXX-XXXX">
<UploadSettings actionURL="."></UploadSettings>

In my code behind I have:

Public Sub Uploader1_FileUploaded(ByVal sender As Object, ByVal e As Global.Aurigma.ImageUploader.FileUploadedEventArgs) Handles Uploader1.FileUploaded

Dim strgalleryPath As String = "./DigitalFiles")
'Save original file.
Dim sourceFileName As String = e.UploadedFile.SourceName.ToString
e.UploadedFile.ConvertedFiles(0).SaveAs(System.IO.Path.Combine(strgalleryPath, sourceFileName))
End Sub

Can you tell me what I am doing wrong?
Dmitry.Obukhov  
#2 Posted : Wednesday, August 17, 2011 8:33:33 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Sandra,

I corrected your server-side script:
Code:

Public Sub Uploader1_FileUploaded(ByVal sender As Object, ByVal e As Global.Aurigma.ImageUploader.FileUploadedEventArgs)

  Dim strgalleryPath As String = Server.MapPath("./DigitalFiles")
                
  ' Get the source file
  Dim file_source As Aurigma.ImageUploader.ConvertedFile = e.UploadedFile.ConvertedFiles(0)
                
  Dim sourceName As String = file_source.Name
  ' Save file to disk
file_source.SaveAs(System.IO.Path.Combine(strgalleryPath, sourceName))
End Sub


You need to add MapPath() method to return the physical file path. Also, please remove Handles Uploader1.FileUploaded. It causes calling Uploader1_FileUploaded event twice. Please try it and let me know about your results.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.