Hello everyone! My current code of uploading a file is as follows:
createFile(
            bucketId: 'id',
            file: InputFile(),
            fileId: 'unique()',
          );
The above code is executed from the client side. The problem here is that an evil person could reverse engineer my code/request and pass anything as fileId. π Such person could do this for example, and the file will end up in my bucket just fine with that modified ID:
createFile(
            bucketId: 'id',
            file: InputFile(),
            fileId: 'TROLLOLOLOL',
          );
I don't want the client to have any control over what file ID is uploaded. I could use a function that executes by the file upload trigger, but that doesn't change the fact that the file with the modified ID will be in my bucket, even though itβs for a short time.
The best way (I think) to solve this problem would by passing the file to a function and then process it through that same function. My question is: Is it possible to upload a file trough a function and if so, are there any examples of this?
FYI, it's best to wrap multiline with 3 backticks. See: https://www.markdownguide.org/extended-syntax/#syntax-highlighting.
Recommended threads
- Internal server Error when trying to exe...
When executing the function locally it works fine, but when the function is deployed I get this error: ```requests.exceptions.HTTPError: 500 Server Error: Inter...
 - Deploying Function fails after several d...
I get the below issue on deploying to self hosted appwrite 1.8.0 functions, restarting the docker compose, or waiting a while, fixes it but is annoying. Any ide...
 - One org lost all data out of 13 org's af...
> https://<domain>/v1/storage/buckets?queries%5B0%5D=%7B%22method%22%3A%22limit%22%2C%22values%22%3A%5B6%5D%7D&queries%5B1%5D=%7B%22method%22%3A%22offset%22%2C%...