Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

(PUT) /api/files/file?token=&locale=&folder=&filename=

Please note that this is an HTTP PUT and not a GET action. The binary data of the file must be included in the message body.

...

token

The session token obtained when connecting.

locale

The source language. This must correspond to the project source language code.

Language codes are ISO 2 letter codes such as “en”, “fr”, “en-GB”, “en-US”, etc.

filename

The relative path of the file including sub-directories.

  • This can be a simple file name like “myfile.xml”.
  • Or, it can include directories such as “folder1\folder2\myfile.xml”.

Note the use of backslash separators as it is common on Windows systems.

The file will be saved to the project input directory with the specified sub-directories. Sub-directories are created if these do not yet exist.

Using sub-directories is useful if you want to organize files into folders.

folder

Optional.

Folder name

MESSAGE BODY

Add the binary content of the file to the message body.

Set content type to "Stream", such as in: Content-Type: Stream

Do not use multi-part MIME contents as this is not supported by the Beebox.

 


The file will be saved to the project input directory and then picked up from there by the Beebox. Always make sure to verify the HTTP status to make sure that your operation succeeded.

Example: If you specify the filename “folder1\myfile.xml”, the file will be saved to “c:\beebox\{project id}\in\folder1\myfile.xml”.

...

You send the Japanese file "pages\page1.html":

...


Code Block
/api/files/file?token=...&filename=pages\page1.html&locale=ja 

            MESSAGE BODY:
            The original Japanese html code (UTF-8 or other code page)
 


 Internally, the file will be saved to the Beebox project directory in this location: 


Code Block
c:\Beebox\{project key}
    \in
        \pages\page1.html
 


The "pages" sub directory is a folder included in the "filename" parameter above.

...

Second, click the "Headers" panel and set the Content-Type to Stream (first letter capitalized):