-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📚 Documentation: update file with content #11
Comments
You can only update the file permissions like this: <?php
use Appwrite\Client;
use Appwrite\Services\Storage;
$client = new Client();
$client
->setEndpoint('https://[HOSTNAME_OR_IP]/v1') // Your API Endpoint
->setProject('5df5acd0d48c2') // Your project ID
->setKey('919c2d18fb5d4...a2ae413da83346ad2') // Your secret API key
;
$storage = new Storage($client);
$result = $storage->updateFile('[FILE_ID]', [], []); For what you're trying to achieve, you have to delete the old file, and create a new one. |
More info is available here: https://appwrite.io/docs/server/storage?sdk=php-default#storageUpdateFile |
Ok, thanks, I saw that page. But It din't make sense to me as you can't upload a file to the file with the same ID. |
I saw in your example that you entered https://[HOSTNAME_OR_IP]/v1. How do I get https to work with my IP? Should I install certbot? In my experience, it only works with Apache? Which I don't want to use as my 80/443 ports are used by my appwrite. Thanks |
That is true, the ID will be different. You will have to update your database and set the new ID there. In future, we plan to support Custom IDs that will allow you to set anything as an ID - this will allow you to create a new file with the same ID. |
You could generate custom certificates for your IP address manually (self-signed), but I am not sure how secure that is - browsers might still complain. I recommend you get a domain and set up HTTPS on the domain name. Let's Encrypt (tool Appwrite uses) issues domain-validated certificates. The certificates must be attached to at least a domain name. |
Hi meldiron, thanks for your feedback. I upgraded to version 0.12, so I'll test and see if we can now use custom IDs. Re. HTTPS, I used Let's Encrypt with a specific domain. Thanks |
@Meldiron is this still relevant? If not please close this. |
💭 Description
Hi, after reading your documentation, I could not figure out how to update a file I created earlier with new content. Please help. Thanks
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: