Jump to content

Drag and drop file uploader

Recommended Posts

Hello Caspio Universe! I was wondering if anyone out there had come across a way to incorporate drag-and-drop file upload instead of the standard file picker.  I've been researching this out there for some solutions so I figured I'd see if anyone else has encountered any script and css that works well in caspio. Any advice would be appreciated! 

thanks so much

Link to comment
Share on other sites

15 hours ago, EvSam said:

I wonder if I can play with the fileupload element to create a "box" for folks to drag and drop a file into instead of displaying the file picker.

I'm not too sure how to change the text in the 'Choose File' button. But, you can definitely change the way the element looks. 

#InsertRecordFIELDNAME {
  height: 200px;
  border: 1px dashed;


Link to comment
Share on other sites


 I'm not sure we can easily change the text in 'Choose File' button. I've looked at the following places:


But, it seems that Caspio use slightly different code for a input file element, you can maybe try temper with it yourself...

Link to comment
Share on other sites

  • 1 month later...

Hi - Just wanted to share this solution. If you want to restrict file type in multiple fields, just like in this article: https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/restrict-file-types-that-can-be-uploaded-in-a-datapage/

You can use this code:

<script type="text/javascript">

var files = Array.from(document.querySelectorAll('#InsertRecordFIELDNAME1, #InsertRecordFIELDNAME2, #InsertRecordFIELDNAME3, #InsertRecordFIELDNAME4, #InsertRecordFIELDNAME5'));

var extensions = ['pdf'];

files.forEach(function(el) {
el.addEventListener('change', function(e) {

var ext = this.value.match(/.([^.]+)$/)[1];

if (!extensions.includes(ext)){

alert('Invalid file format. Please upload PDF only.');

this.value = '';



Hope it helps!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...