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 upload files and other fields and update those in the database. The files will be saved on the server and their names and the other form fields will be updated in the database.
To make file upload and update a record, you need to:
You can start with an any page where you have a form on it with one or more entry fields. You need to add a file upload field if you haven't got one yet. If you haven't done it yet, go through the Simple file upload tutorial. So your form will look like:
TIP: You might also reuse the form you created for Upload and insert record form tutorial, but delete all server behaviors first.
Choose the Update Record Server Behavior from the Server behaviors palette.
Select your database connection and table where you want to save the data in.
Assign all the entry fields from the form to the corresponding fields in your database.
Enter a redirect page at After Updating, Go To this will be the follow up page.
Click OK to insert the server behavior.
Select the Pure ASP.NET Upload dialog by choosing it from the Server Behaviors palette, DMXzone / Pure ASP.NET Upload.
Choose upload folder, Images only but don't enter a redirect url in the Go To field. This is because you already have a redirect in the Upload Record server behavior.
To read more about uploading images read Allowing only images upload tutorial.
To read more about limiting the image size read Restricting image width and height tutorial
Save your page and upload it to your server, and you are done! Go to your website and test it - you should be able to upload images together with other form fields and all fields should be updated in your database. Don't forget to pass an existing Id as a parameter.
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.