Skip to content

Cannot upload a file using REST API and GridStoreAdapter #1702

Closed
@geo8bit

Description

@geo8bit

Environment Setup

This is my server's configuration:

{
  databaseURI: databaseUri || 'mongodb://username:password@localhost:27017/mydb',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myappid',
  masterKey: process.env.MASTER_KEY || 'masterkey',
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',
  publicServerURL: 'http://myserverip:1337/parse',
  fileKey: "myfilekey"
}

Steps to reproduce

I'm using a custom made service in angular. This is the code I'm using to upload files.

    ParseService.prototype.uploadFile = function(file) {
        return $http({
            method: 'POST',
            url: this.api.url + "/files/" + file.name,
            headers: _.extend(_.clone(this.headers), {"Content-Type": "image"}),
            data: file
        });
    }

I also tried to upload a file using parse-dashboard and I get the same response.

Logs/Trace

When I'm trying to upload a file in my migrated app I get this response:

{"code":130,"error":"Could not store file."}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions