Skip to content

Typo in new FileUpload options #7602

Closed
Closed

Description

@Vortec4800

This issue is for the latest release of Parse Server, 4.10.4, regarding #7071.

In all the documentation everywhere, and in the sample config, the new options are listed as:

fileUpload: {
  enabled: true, // Is true if files can be uploaded with Parse Server. Default is true.
  enabledForAnonymousUser: false, // Is true if file upload is enabled for Anonymous Users. Default is false.
  enabledForPublic: false // If true if file upload is enabled for anyone with access to the Parse Server file upload endpoint, regardless of user authentication. Default is false.
}

I set these keys in my config but still couldn't get it to work. Finally after digging for a while, I realized in the actual FilesRouter.js where the config options are checked, it's listed as:

if (!isMaster && !config.fileUpload.enableForPublic && !user) {
  next(new _node.default.Error(_node.default.Error.FILE_SAVE_ERROR, 'File upload by public is disabled.'));
  return;
}

Note this shows enableForPublic instead of enabledForPublic as above.

I don't know if this is a documentation bug or a bug in the Router, but I wanted to highlight this in case someone else was trying to get it working.

Activity

  1. parse-github-assistant commented on Oct 2, 2021

    @parse-github-assistant

    Thanks for opening this issue!

    • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.
  2. dblythy commented on Oct 2, 2021

    @dblythy
    Member

    Nice catch! Would you be willing to submit a PR?

  3. Vortec4800 commented on Oct 2, 2021

    @Vortec4800
    ContributorAuthor

    Sure thing... Just need to know which one is correct 😁

  4. dblythy commented on Oct 2, 2021

    @dblythy
    Member

    If it’s consistently enableForPublic in this repo, then there’s no point in my opinion to change it (as it would be a breaking change for configurations that are already using the correct option.

    I think updating the documentation is the easiest approach. What do you think?

  5. dblythy commented on Oct 2, 2021

    @dblythy
    Member

    Could you point to the documentation that is outdated?

    The fileUpload feature is an unreleased feature, not available on 4.10.4. It will be available on V5, or, is currently available on the master branch.

    https://github.com/parse-community/parse-server/blob/master/CHANGELOG.md

  6. Vortec4800 commented on Oct 2, 2021

    @Vortec4800
    ContributorAuthor

    I see that now in the changelog. This is my mistake, most of my projects specify the latest version but for some reason, this one had the full repo URL instead of a version so it grabbed master. I was thinking this was version 4.10.4 but you are correct, this project was on master by mistake. Might have been filled in "helpfully" by WebStorm or something.

    Well, we should probably leave this issue open for the time being because the bug still exists - just not in production. Given it hasn't been released yet, probably easiest just to update the Router to match the spec/doc/etc. I can send in this PR if that sounds like a plan.

  7. dblythy commented on Oct 2, 2021

    @dblythy
    Member

    Well, we should probably leave this issue open for the time being because the bug still exists

    Could you point me to where in the project/documentation the "enabledForPublic" code is? I can only find it in outdated PRs that weren't merged, such as this comment and #6997.

    The merged spec seems to consistently use enableForPublic.

  8. Vortec4800 commented on Oct 2, 2021

    @Vortec4800
    ContributorAuthor

    Yes you're right, I was looking at the outdated PR #6997 and grabbed the options from there. I thought it was weird that I couldn't find good documentation elsewhere, I guess it's been a long week...

  9. dblythy commented on Oct 2, 2021

    @dblythy
    Member

    No worries at all! We'll add the full fileUpload documentation to the docs once V5 is released.

  10. Vortec4800 commented on Oct 2, 2021

    @Vortec4800
    ContributorAuthor

    Makes sense. Thank you!

  11. added
    type:docsOnly change in the docs or README
    and removed
    type:questionSupport or code-level question
    on Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:docsOnly change in the docs or README

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions