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
- 4.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions