-
Notifications
You must be signed in to change notification settings - Fork 156
Prototype Uploads are hanging #237
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
Comments
@b-admike , is it the same issue you've been helping? |
Yeah, I was debugging @jocelynk's app, but didn't find the cause of the issue. However, #196, among others, is very similar to this issue, and the sandbox app from there, https://github.com/PArns/loopback-stuck-test provides a working example. |
@jocelynk when you use the It is beyond our scope to decide and implement which To fix your CURL code just remove the duplicate This is a case of improper setting of headers, so closing this. |
@hacksparrow I removed the header and it still does not work. The request still hangs and I still get the same error:
I am using this curl command:
I have given up using the loopback-component-storage connector, so you can leave this Github issue closed, but I think there is still a bug with uploading files using this connector. |
Re-opening because @jocelynk is still seeing the issue. |
@jocelynk remove that If you want to set at all, use @b-admike this is a case of improper headers. |
@hacksparrow This is not a case of improper headers. I have tried both of these curl commands and both return the same
and
The prototype upload method does not work. See this issue here that was never resolved and was marked as stale instead: #205 |
I am on a Mac using loopback 3.11.1. |
Can you update to 3.18.3 and see if you still face the issue, please? |
I am still facing the same issue after the update. These are packages and versions I am using:
Do you have a sample app somewhere that I can clone and try to run? I get the same errors on the samples available on this repo. |
@hacksparrow I have discovered the issue. It is because I am using multer as middleware to filter my files. Does loopback-component-storage use formidable under the covers? I'm guessing multer is trying to read the same stream and interfering with the reading done by formidable. You can close this issue, but is there somewhere you can update in the documentation on this repo that prototype uploads will not work if you try to use multer in conjunction with loopback-component-storage? |
@jocelynk yes, |
@jocelynk how did you handle this? I am getting an error when using multer as well, and if I remove multer, I get a validation error. @hacksparrow @b-admike could you help check why I get the validation error if I remove multer? Sample repo https://github.com/pbalan/component-blog Steps to reproduce
{
"email": "[email protected]",
"password": "password"
}
{
"postTitle": "Blog post - one",
"postType": "text",
"postText": "dummy post data",
"createdAt": "2018-09-30T16:46:21.737Z",
"modifiedAt": "2018-09-30T16:46:21.739Z",
"isEnabled": true,
"deletedAt": null,
"isReported": false
} |
UPDATE: I figured out why validation fails. Its because I am using form-data in POSTMAN and headers were not application/x-www-form-urlencoded when I remove multer. I am still looking help to process multipart/form-data to pass the file to Current behaviour: socket hangs Expected behaviour: file uploads and returns the response from files API. |
@pbalan I think you might have problems with loopback-component-storage
so if you would go to
then you should not be getting.
Generally it would be much easier if you would provide us a failing test case with your scenario :) |
@arjamizo Thanks for your time. I have provided the repo to reproduce the error above. And I think this is not the main issue. If you pass the token in URL string, you can overcome the above issue you mentioned. In my case, I am not passing just the file. I am passing a file with form fields. In that case it doesn't work quite well. The only solution to this I found was to create a remote method and disable the default remote "create" method for Post. I'll post my solution using |
I am having an issue of being unable to use the loopback-component-storage to do uploads. It does not work with IBM COS or the file system. I did not create any custom remote method but am using the prototype upload method provided by the connector.
Error I am getting:
Sample CURL response I am using:
Sample project: https://github.ibm.com/Jocelyn-Kong/lb-debug
The text was updated successfully, but these errors were encountered: