Welcome to the tutorials of Pure ASP.NET Upload.
What will you learn:
- How to create a file upload
- restrict certain files or sizes of files from being uploaded
- upload files and insert them in a database
- and much more...
What will you learn:
In this tutorial we will explain how to save the image size in the database.
To save the uploaded image size in the database, you need to:
Start with an insert or update record page where you have Pure ASP.NET Upload on it. We have created those pages in the Upload and insert record form and Upload and update record form tutorials.
To save the image size in temporary fields first, you need two hidden fields. Insert those and name them imageWidth and imageHeight for example.
Select the Pure ASP.NET Upload dialog by opening the Server Behaviors Panel. Select DMXzone - Pure ASP.NET Upload.
Make sure you've selected Images Only for your allowed extensions.
Go to the Advanced tab of the Pure ASP.NET Upload options. There choose the hidden fields you just created in the Save the Image Properties in Hidden Form Fields section.
After you apply the Pure ASP.NET Upload extension, it will save the image size in the hidden fields. Now we need to apply the Insert Record server behavior (or Update Record if you are using an updating a page) to also save the hidden fields.
You should assign the hidden fields to the fields in your database.
Save your page then, upload it to your server, and you are done! Go to your website and test it - you should be able to upload images and their size will be saved in the database!
NOTE: This method will work only if you upload a single image! It won't work if you try to upload multiple images at the same time - ie if you have multiple file upload fields in your form.
George Petrov is a renowned software writer and developer whose extensive skills brought numerous extensions, articles and knowledge to the DMXzone- the online community for professional Adobe Dreamweaver users. The most popular for its over high-quality Dreamweaver extensions and templates.
George is also the founder of Wappler.io - the most Advanced Web & App Builder
Comments
Set FTP permissions using ASP?
How to set (FTP) permissions on certain folders using ASP?
I have no problems doing this in PHP.
How to do it in ASP?
(CHMOD 0777 then CHMOD 0755 after your'e done with the uplaod?)
Cheers
You must me logged in to write a comment.