Gallery CMS
Gallery CMS > .NET CMS online support forum > Forum of online support > Configuration

Batch Upload Images

Date & Time
Message Operations
Chris Morgan

Info on the Gallery CMS website mentions "Provides a powerful engine for uploading and managing galleries of images, with the ability to BATCH UPLOAD, add/delete/rearrange/ images, group galleries into albums, and more."
I can only see how to upload one image at a time. Please point me in the right direction.
Andrea Bruno

To begin you must download the latest version of CMS from here:

You can take as an example the file: uploadphoto.aspx
Otherwise: This sample code creates a child photo-album, into the main tree photo-album:

Dim RootPhotoAlbum As PhotoAlbum = PhotoManager.PhotoAlbum.Load.GetItem(NameRootPhotoAlbum)
If RootPhotoAlbum Is Nothing Then
RootPhotoAlbum = New PhotoAlbum
RootPhotoAlbum.AddPermitted = PhotoManager.Permission.Permitted
RootPhotoAlbum.Deletable = False
End If
Dim PhotoAlbum As PhotoAlbum = RootPhotoAlbum.CreateSubFotoAlbum(CurrentUser(Session), Setting)
PhotoAlbum.IsRoot = True
PhotoAlbum.Editable = PhotoManager.EditablePermission.Author
PhotoAlbum.AddPermitted = PhotoManager.Permission.Author
PhotoAlbum.Deletable = PhotoManager.Permission.None
PhotoAlbum.SubPhotoAlbumsNotCreatable = True
PhotoAlbum.Title(Setting.Language) = "Title of photoalbum"

This sample code adds a picture to the photo album:

Dim Photo As New PhotoManager.Photo
Photo.Album = PhotoAlbum
If Not String.IsNullOrEmpty(Photo.Album) Then
Photo.FromUrl(ImageUrl) 'In alternative you can load a photo from stream
'Photo.FromStream(Stream) 'You must first open the file and create a stream object
Photo.Title(SubSite.Language) = Author
Photo.Description(SubSite.Language) = Title
PhotoID = Photo.NameCode()
End If