Closed afaucogney closed 8 years ago
Thanks for reporting this! The code looks correct, this should totally work. Could you please check the following?
What is the version of the Tinify client you are using? Try npm list | grep tinify
. The current version is 1.1.1.
Is the buffer actually empty? Maybe try the code with the following line:
downloader.on('end', function (buffer) {
console.log(buffer);
console.log("done buffer downloading for", filename);
// ...
I have the good tinnily version. The buffer is not empty.
Nothing has been changed, but it is now working. Maybe some workload on your side or on was…
Is there a way to know progress when we use store :
With this, we may track issues in the workflow.
Le 22 janv. 2016 à 20:08, Rolf Timmermans notifications@github.com a écrit :
Thanks for reporting this! The code looks correct, this should totally work. Could you please check the following?
What is the version of the Tinify client you are using? Try npm list | grep tinify. The current version is 1.1.1.
Is the buffer actually empty? Maybe try the code with the following line:
downloader.on('end', function (buffer) { console.log(buffer); console.log("done buffer downloading for", filename); // ... — Reply to this email directly or view it on GitHub https://github.com/tinify/tinify-nodejs/issues/2#issuecomment-174014519.
Thanks for checking. This is an interesting result. I'm happy that it works now, but we will investigate to see if there is any issue on our side that may cause 400 (InputMissing
) errors instead of 500 errors.
Upload & compression happens directly after each other. You can use the core Node HTTP library to report upload progress events, which will tell you when the upload has arrived completely at our servers.
We don't offer that as a feature in the client, though. But feel free to copy and reuse code from our client to implement it if you want.
We don't report any other progress events back yet, but we generally try to make failures as clear as possible through our use of HTTP status codes. This is reflected in the exception classes in the client, which are of type AccountError
/ClientError
/ServerError
/ConnectionError
.
Here is the code I use without succes.
The store does work, but I do not want save every file on my computer to them uploading them again.... I will deploy this on a Heroku dyno when it will work.
I get this error about file aspect.
Feel free to add my code to improve my debug visibility.