Skip to content

Parse Files saved hardcoded in json in array. #7123

@uzaysan

Description

@uzaysan

New Issue Checklist

Issue Description

I have files in json. And I put that json inside of an array. But seems like parse files are saved hardcoded. Even we change fileAdapter, or baseUrl in file adapter, files return with the old url.

Steps to reproduce

Here is an example. This is How I save my files.

    for(var i = 0; i < mediaList.length; i++){
      //...other logic
    
           
      var mainmedia = new Parse.File(user.id, { base64: mediaData },mimeInfo.mime);
      var thumbfile = new Parse.File(user.id, { base64: thumbnail },mimeInfo.mime);
      

      var item = {"type":"image","width":ratiow,"height":ratioh,"media":mainmedia,"thumbnail":thumbfile};
      itemList.push(item);
    
    }
    post.set("media",itemList);

And baseUrl in my adapter is : http://files.example.com

Now file is saved with this url: http://files.example.com/filename

But If change baseUrl to this: http://my-new-file-endpoint.example.com
I still get http://files.example.com/filename but I should get http://my-new-file-endpoint.example.com/filename

Actual Outcome

I get old url
http://files.example.com/filename

Expected Outcome

I should get http://my-new-file-endpoint.example.com/filename

Failing Test Case / Pull Request

  • 🤩 I submitted a PR with a fix and a test case.
  • 🧐 I submitted a PR with a failing test case. (here)

Environment

Server

  • Parse Server version: 4.5 //But got the same result in previous versions too
  • Operating system: Ubuntu 18.04
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Remote server

Database

  • System (MongoDB or Postgres): Mongodb
  • Database version: 4.4
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): remote

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