For VB.NET developers.
VB.NET - Upload Multiple Files with Thumbnail, Folders, and SQL Server Database«
UPDATE = 12/31/2022
I found an issue with the code while working on our Music site; once I fixed the issue on the site, I updated the code here. So now it will work with network and local folders.
What this script does.
- June 14, 2022 - Ported over from VB.NET to C#, this upload script is very robust, allowing you to upload many files. Easily changed in the web.config file and the JS script.
- Page checks if there is a QueryString["ID"] available. If not, a warning is given with a link to click. The buttons on the page are also disabled until a valid ID is present. This part can be expanded to include a check against a database to ensure the user who uploads the images has a valid ID and is logged in to their account before everything is set and available.
- If the file is larger than the set file size, it will show an error, and the file will not be available for uploading.
- Create two folders, Big and Thumbs, with the ability to add more folders easily within the aspx.vb file and within the web.config file.
- Images are resized using the resizeImage() function. Images are not only smaller in diameter but pixel size as well.
- Information inserted into SQL Server Database. (Included Table Script)
The database table information is listed here.
Table name: ImageServer
- [PicsID] [int] IDENTITY(1,1) NOT NULL,
- [PicsFolder] [nvarchar](50) NULL,
- [Userid] [int] NULL,
- [DefaultFolder] [int] NULL,
- [PicsPath] [varchar](255) NULL,
- [PicsName] [nvarchar](50) NULL,
- [PicsSize] [int] NULL,
- [PicWH] [varchar](50) NULL,
- [PicDate] [datetime] NULL,
- [DateUpdated] [datetime] NULL,