-
-
- Search Engine Optimization
- OTP
- User Interface migration guide
- User account management
- Instructies voor implementatie van visueel editen van nieuwsbrieven
- Login as another user
- Support
- More information about moving to User Interface Version 4.0
- Standaard page layout
- Sections moved to layout
- Aanpassingen in release 2024-7
- Media library
- Aanpassingen in release 2024-10
- Analytics and Matomo
- Registration forms
- How to change names of classes and fields?
- Responsible Disclosure Policy
- How to upload a blob in Velocity?
- Aanpassingen in release 2024-2
- Instances
- Google Analytics
- Street and City helper (postcodecheck)
- Responsible disclosure-beleid
- Postcode check service (straat en huisnummer) kosten
- Expressions
- Regular Expression Reference
How to upload a blob in Velocity?
There are some options.
- Use a HTML form
In this example we have a form in/upload/form.vm
This form needs to use thepost
method and enctypemultipart/form-data
. You can only submit files in this way. Other inputs types will not be included in the post parameters. You can use the action url to include parameters. For instance:/upload/form.vm?foo=bar parameter
can be asked with$request.get('foo')
You can use themultiple
attribute on the file input, to upload multiple files at the same time.
This will be submitted to/upload/action.vm
Here we get all the blobs (files). With a#foreach
loop we loop over the blobs and put each one in the field image of a record that has the class image.
- Use JavaScript and AJAX
In this example we have a similar form in/upload/ajax_form.vm
When using JavaScript (and AJAX) the same rules apply. We need thepost
method and enctypemultipart/form-data
.
From the file
/upload/ajax_action.vm
you can return a message on success or failure. In the example above this gets logged in the browser console.