I’ve searched the forum to try and find a method but I haven’t found anything. Basically, I’m trying to send a simulation of a file to the Trello API in order to attach it to a card.
What are you attaching? If you are attaching a roblox image, you just use roblox content service url to get it. Here is the url: https://www.roblox.com/Thumbs/Asset.ashx?width=420&height=420&assetId=" .. assetID
Why are you trying to send a file through Roblox? You can’t do that unless you make the up the binary data for it, as stated by the documentation:
Roblox does not allow for uploading of files, so either update the description of your card to include the said text or guide it through a proxy. If you are really dedicated, create the appropriate binary representation of said file and send it over using the file argument.
If you aren’t doing this via Roblox, then this isn’t the forum to post it with. If you are using an external service and have no connections to the Roblox platform, then utilize StackOverflow instead.
Lastly, I personally do not see why you’d attach it as a file, but you know what’s best. To do it purely via Roblox, you need to convert the string to binary data that represents a txt file with the string contents. If not, then you could utilize a proxy that uploads the file based on what is received. That seems like an easier solution to me.
If you want to convert it to binary, then you can try utilizing pre-made Base64 Lua libraries in order to encode the string and from there do some research on the Base64 representation of a txt file. A base64 lua converter that I was able to find was iskolbin/lbase64. See if you can get away with sending just the converted text, otherwise you’ll need to figure out a way to “convert” it into a txt file.
As far as I can tell, this isn’t necessary. It appears files are just loaded as plain text on a string, so a .txt file will just have the actual, readable text that’s written inside it, and using :GetAsync gets that text. I’m not sure if it’s different for :PostAsync, but I think it’s a reasonable assumption that a file is just represented as a string of it’s contents.
I do not believe so. The documentation specifies binary data, along with some extra parameters to specify the file name and file type. This was also visible on other posts asking for help on the API. All of them converted to binary data. Additionally, this is an API that can be used to upload literally any type of file, so having a string passed as a parameter seems odd, especially when considering that the expected parameter is binary data. I do strongly believe that conversion is needed as it would make the most sense.