[New Feature] [Beta] Large file uploads

Finally

When you do, please expose a progress (% complete) hook for plug-ins as well. :slightly_smiling_face: (Iā€™m eager to take advantage of that for a custom uploader that I wrote, which uses the existing context.uploadContent() function.)

@cal
I have a strange issue. Tested with 3 files, one uploaded under v5 and two uploaded under v6.

With axios (nodejs) set to maxRedirects: 0 (unlimited) i get a 302 for the v5, a 200 for one v6 and 302 for the other v6.

The code is pretty basic and have worked perfectly under v5.

const axios = require('axios'); 

let token = 'mytoken'
let fileUrl = 'https://my-app.domaon.com/version-test/fileupload/f12345x54321/file.docx'

async function getFile(){

    const options = {
        responseType: "stream",
        headers: { Authorization: `Bearer ${token}` },
        maxRedirects: 0
    }

    const res = await axios.get(fileUrl, options)
    return res.status
}

getFile().then(console.log)

@simon7
We issue redirects based on what version your app is at time of request, not what version it is when you uploaded them. So, if you tested the one uploaded under v5 after upgrading to v6, we will redirect that request.

Also, I think the axios maxRedirects of 0 is actually no redirects, not unlimited (but may sometimes follow redirects anyways: see here https://github.com/axios/axios/issues/1227).

If the issue persists / prevents you from being able to upgrade, please submit a bug report or DM me some more information so I can fix the issue! Also, if the v5 behavior is different from what it was before, that is also bad, so please let me know.

Great! All we need now is the option to specify our own s3 buckets in our own AWS regions so we can upload more than 2 x 5gb files before blowing our monthly plans and manage our own app storage and files.

12 Likes

Hi @cal ,
Did some more tests. I probably mixed up the not-working v5 and the working v6 file, so the v5 works as expected but the v6 dont. I did of course try other values than 0 in maxredirects :wink: Those gave a 400. Also tried with node-fetch (incl. redirect: follow, follow: 20 as options).

I will send a bugreport in a bit. I see that I can downgrade for a week, should a revert now or is it better to wait so you can do some testing?

Hello @cal.

Before upgrading to v6, when I assigned the current anonymous user to a field, the field was empty (user_field is empty was ā€œyesā€).

Now the field actually has the temporary user (so now, user_field is empty is ā€œnoā€).

Is this new behaviour related to v6?

Thanks.

Thanks for the bug report. If itā€™s breaking functionality for your app (and your app is live), definitely downgrade for now and wait (you can upgrade/downgrade as much as you want without breaking your application). I will be able to do testing no matter what version your app is on.

1 Like

Hi @miguel. That sounds like an unrelated bug, mind submitting a bug report?

The v5/v6 upgrade only affects file upload size and how we deliver those uploaded files to users. It doesnā€™t touch anything else (and you can confirm this by downgrading back to v5; the bug will still persist).

Thanks for your quick response!

Youā€™re right. This behaviour is unrelated to v6 as I just tested it with v5 and the behaviour is the same.

Apologies for adding noise to this thread!

1 Like

Since the upgrade large files i have notice a period of file being uploaded with geturl and I cant seem to access the documents unless its from the editor.

Not sure how to fix this as there are some 100 or so files like this, last few days I have not seen the issue but have downgraded to be safe.

Hey @it1,

I have notice that same problem with one of my appy.
When I check ā€œAttach this file toā€ to some file uploader, depending with thing I select to attach, the file being uploaded with geturl and I cant view them.

Hello everyone,

We just pushed an update to the beta which allows plugin authors to take advantage of the new large file uploads. To use it, you must enable the ā€œMax file sizeā€ and ā€œLarge file uploads enabledā€ conditions on your element, and then you get access to a new function (instance.uploadFile) to upload any file that is within the file size specified on that element. This should ensure that app owners are still offered the same security guarantees for their large files, where these properties will be evaluated server-side on upload.

Please try this out and let me know of any feedback!

4 Likes

Thanks for the info, @cal. Is the upload progress exposed for devs to take advantage of?

@sudsy Yes! Here is the documentation for the functions:

     uploadFile: function(file: File, callback: function(err, url), [attachTo], [progressCallback: function(num)])
                 file: A Javascript File object for use in the upload
                 callback: Once upload completes or fails, this function will be called
                 attachTo: optional parameter to attach the file to. It has to be a thing in Bubble
                 progressCallback: if present, will be called with a number from 0 to 1 while file is uploading
           This will upload a file of size up to the "Max file size (MB)" property on the element, and only if "File uploads enabled" is true.
           Please make sure app owners installing your plugin fill these out.
           NOTE: this feature is in public beta.
     canUploadFile: function(file: File) - checks if a file can be uploaded, according to the properties
4 Likes

You da man! :slightly_smiling_face: :+1:

Canā€™t wait to get back to my machine and try it out.

Did you find a fix to this issue? I am having some similar problems but not yet diagnosed source.

Now the upgrade was fixed, any chance we can change the destination of the upload to a different AWS db?

1 Like

Great upgrade!

I use the plugin AWS file upload and have quite a few files stored. How do I transition to using this new feature in Bubble (which I very much would like to do since AWS is a bit cumbersome)?

// Peter

Also wondering if thereā€™s a way to stop an upload in progress.

1 Like