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

Cannot upload a file using REST API and GridStoreAdapter #1702

Closed
3 tasks done
geo8bit opened this issue May 4, 2016 · 5 comments
Closed
3 tasks done

Cannot upload a file using REST API and GridStoreAdapter #1702

geo8bit opened this issue May 4, 2016 · 5 comments

Comments

@geo8bit
Copy link

geo8bit commented May 4, 2016

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."}
@geo8bit
Copy link
Author

geo8bit commented May 4, 2016

I'm hosting the DB and the parse-server in a digital ocean droplet.

@drew-gross
Copy link
Contributor

To help us debug this, can you include the exact request and response in Parse Server? (you can see this in the logs using VERBOSE=1 environment variable)

@geo8bit
Copy link
Author

geo8bit commented May 10, 2016

@drew-gross

Thank you for your response. I tried this and it doesn't seem to catch this request, it logs everything else though. I used export verbose=1 and checked the logs in nohup.out. Also tried verbose:true in my parse-server config. Any idea why would that happen?

@drew-gross
Copy link
Contributor

I don't. Can you check the network requests in the Chrome debugger and make sure the requests are going to the right server and doing what you expect?

@flovilmart
Copy link
Contributor

Closing due to lack of activity, please update to latest parse-server version and reopen if the issue persist.

Don't forget to include your current:

  • node version
  • npm version
  • parse-server version
  • any relevant logs (VERBOSE=1 will enable verbose logging)

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

3 participants