Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

Create file API

Updated on April 5, 2022

The create file API is a savable data page, D_pxNewFile. The API represents the new file as a data page when it is loaded. You can use this API to create a file or overwrite an existing file.

To define a file with this API, define the following parameters:

  • repositoryName – the name of the repository in which to create the file.
  • filePath – the path, including the name of the file, to be created, relative to the root path of the repository. To find out what the path is, run D_pxListFiles against the repository and view the pyPath property.

This API accepts a base-64 string as the file content or a java.io.InputStream object as the source for file content. If both options are specified, preference is given to the string. If neither option is specified, an empty file is created.

Set the file content, pyContents, or the stream, pyStream, on the data page.

Note: For large files, use the java.io.InputStream option.

To create a file, save the savable data page. For information about how to save savable data pages, see step 13 in Creating a data page save plan.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us