Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Blueprints: Add file upload > filesize: 0 > not working #855

Closed
ponderboy opened this issue Nov 5, 2016 · 16 comments
Closed

@Blueprints: Add file upload > filesize: 0 > not working #855

ponderboy opened this issue Nov 5, 2016 · 16 comments

Comments

@ponderboy
Copy link

I have the maximum filesize within the settings set to 0. Within a page blueprint I added a file upload and there also set the filesize to zero (which should be unlimited, shouldn't it?). When dragging in a picture I get:

File is too big (0.07MiB). Max filesize: 0MiB.

@flaviocopes
Copy link
Contributor

No, 0 does not mean unlimited in DropzoneJS which is the lib we use for the file uploader http://www.dropzonejs.com/#config-maxFilesize

There seem to be no value for "unlimited"

@ponderboy
Copy link
Author

Strange. I'm pretty sure I used it before and it worked. (Prior the last update) Also in the documentation it says:

When set to 0, it is considered unlimited, ...

https://learn.getgrav.org/forms/blueprints/how-to-add-file-upload

Well then, good to know. Thanks.

@flaviocopes
Copy link
Contributor

I didn't check that, it might be as well be unlimited, and you're having a different issue. Going to check if I can replicate.

@w00fz
Copy link
Member

w00fz commented Nov 7, 2016

You cut off the other portion of the docs :)

When set to 0, it is considered unlimited, however it is constraint to your Grav system.media.upload_limit as well as your PHP setting

@ponderboy
Copy link
Author

Because, it is the important part within my issue. System and PHP Settings are adjusted as I wrote (though not so clearly):

I have the maximum filesize within the settings set to 0 ....

And it says in the docs:
https://learn.getgrav.org/admin-panel/configuration-system#media

;)

@flaviocopes
Copy link
Contributor

Disregard my previous comment - limit: 0 works fine to me, it's unlimited and I can upload any file size in my testing.

@ponderboy
Copy link
Author

I've just tried out a blank install of grav cms, due to some other error I got, and there those issues don't come up. So I think this thread can be closed...
Thank you guys.

@w00fz
Copy link
Member

w00fz commented Nov 8, 2016

Feel free to reopen if this happens again.

@w00fz w00fz closed this as completed Nov 8, 2016
@ponderboy
Copy link
Author

Well, the problem occurs again:
File is too big (0.11MiB). Max filesize: 0MiB.

However I don't get the error if I drag files in the default uploads field of the page.

# works  
        uploads:
          label: Default Upload
# doesn't work
        header.file:
          title: File
          type: file
          label: File Upload
          style: vertical
          multiple: false
          destination: 'self@'
          random_name: false
          avoid_overwriting: false
          limit: 1
          filesize: 0
          accept:
            - image/*

@flaviocopes
Copy link
Contributor

@anthubbard I tried that snippet and it works fine to me with a 9MB file. Check the PHP limits and Grav system's "File upload limit" setting.

@w00fz
Copy link
Member

w00fz commented Nov 10, 2016

Configuration -> System -> Media -> File upload limit

@w00fz
Copy link
Member

w00fz commented Nov 10, 2016

Can you try setting it to 50000000?

@ponderboy
Copy link
Author

Hey anthubbard,
what exactly was the blueprint config problem? As I have the same problems and would like to know, how you made it work.

@shwshind
Copy link

I need to add file upload functionality in one of my pages. I have gone through grav documentation and all but i am unable to understand exactly which file i have to modify for this. I am very new to grav cms. Any help will be appreciated.

@mahagr
Copy link
Member

mahagr commented Jan 19, 2022

Do you mean the upload limit? It's a PHP configuration, nothing to do with Grav.

@shwshind
Copy link

no..not the limit. I want to add file upload functionality in one of the pages. I tried that page yaml file as well as .md file. but my changes are not showing on UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants