How to Break Up File Into 15MB Chunks?
Greetings,
I'm trying to pass a large file into a flow and would like to break the file into 15MB chunks. How can I cut the file into 15mb pieces?
Comments
-
Hello there,
One approach is to first converted the file bytes to a 64bit encoded string. The string length then multiplied by 3/4 indicates how many bytes would be the equivalent of characters in the string. We can then break-up the string into 15MB chunks, or after every 15,728,640 characters.
To convert file byte to a 64bit encoded string, us the Convert Bytes to Base 64 String step:
To get the length of the string, use the Get String Length step (this is what you'll multiply by 3/4 to get the amount of bytes making-up the string)
https://documentation.decisions.com/step-library/docs/get-string-length?highlight=string%20length
To split the string after every 15,728,640 characters, you can utilize the Split String by Character Positions step. You can use a ForEach loop to split the string as many places as it needed to break the total file.
https://documentation.decisions.com/step-library/docs/split-string-by-character-positions
While I don't know your use case fully to recommend what to do with these file parts, I hope these general steps help!
-Gregory
Howdy, Stranger!
Categories
- 2.1K All Categories
- 17 General
- 154 Installation / Setup
- 986 Flows
- 86 Rules
- 199 Administration
- 203 Portal
- 428 General Q & A
- 594 Forms
- 281 Reports
- 3 Designer Extensions
- 38 Example Flows
- 32 CSS Examples
- 1 Diagram Tile
- 5 Javascript Controls
- 137 Pages
- 1 Process Mining
- New Features
- 147 Datastructures
- 49 Repository
- 163 Integrations
- 25 Multi-Tenant
- 21 SDK
- 39 Modules
- 36 Settings
- 19 Active Directory
- 12 Version 7
- 34 Version 8