REST API download file

Hello, as an m-files customer, we're developing a process to access objects using the Rest API. Accessing the objects and viewing their details has progressed successfully, but we're having some issues downloading the file. When I trigger the download link in the browser with curl, I get the error "The resource you're looking for has been removed, had its name changed, or is temporarily unavailable."

M-Files Server Server 25.3.14681.8

I saw the following hotfix published on the web, but does it concern our version?

Defect: Cannot open link in classic web
ID: 167415
Symptom: In the classic M-Files Web, when a user clicks a link to a document whose file name contains special characters, the operation fails with the error message: "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable". This is because the classic web client double-encodes escaped characters.
Solution: Fixed.

Parents Reply Children
  • There are no errors; the access URL is correct. Postman returns the same URL as a binary file. When triggered via the curl API from a web browser, the content displays the message "The resource you are looking for has been removed, has had its name changed, or is temporarily unavailable" instead of the binary file.

  • You're making two requests, but one works and one does not.  In that case it's a matter of playing spot-the-difference; use a HTTP debugging proxy or similar to identify the differences between the request made by Postman and the request made by the web browser.

    By the way: I am a little confused what you mean by "curl API from a web browser".  There's a couple of things that don't really make sense in that small phrase.  cURL is generally a command-line tool that's used to make web requests.  I'm not sure what the phrase "curl API" means exactly, nor how that directly relates to a web browser (as typically the two are different tools to make HTTP requests).

    If you are able to make a valid request via postman then the issue linked above is not appropriate.  The issue linked above relates to the server being unable to return these items, but the server can (because it works in postman).  Therefore the issue must be related to something different between the two requests.

    Start with a HTTP debugging proxy and log the requests and responses in both instances.  Check whether the raw response contains any helpful information.  If not then start to look at the requests and see what's different.  Things like the path are typically most important (e.g. IDs, versions, similar).  See whether there are other HTTP headers that are included, missing, or may make the comparison invalid (e.g. authentication).

    Once you know why the requests are different then you can start asking questions as to how to resolve those differences and make this work in whatever environment you are trying to use.

  • Alternatively, please do feel free to provide details on those requests (both the HTTP request and HTTP response for both the Postman request which works and the other which does not), and I am sure someone will try to assist.

    If you do provide those then ensure you remove anything which is confidential or could be a security concern (e.g. change the host name and replace any authentication tokens with dummy values).