1

I've had a good look around and can't find any template reference to uploading multiple images with Freeform. In settings i've allowed for 5 files in 'File Count'. I'm using the following template code but it only allows a single file.

<div class="field row field13">
  <label for="uploadPhotos" class="label">Upload photos of the fault</label>
  <input id="uploadPhotos" type="file" name="uploadPhotos.handle[]" placeholder="Please provide any images of the fault" />
</div>

Any guidance appreciated.

Martin

2

There appears to be 2 errors in your code. name="uploadPhotos.handle[]" should be name="uploadPhotos[]", assuming your field name is uploadPhotos. The handle part is unnecessary, unless you were using it like name="{{ uploadPhotos.handle }}[]", but it's redundant since you already are calling the handle to get the handle (but makes more sense when you're automating the template code). 😀

Secondly, you need to specify multiple attribute if you wish to have more than 1 file uploaded.

The correct code should be:

<div class="field row field13">
  <label for="uploadPhotos" class="label">Upload photos of the fault</label>
  <input id="uploadPhotos" type="file" name="uploadPhotos[]" multiple />
</div>
1
  • Apologies for the delayed reply - This worked for me thanks :) – Martin Feb 28 '19 at 15:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.