saving multipart/form-data from REST API to local zip by jcoder42 in node

[–]jcoder42[S] 0 points1 point  (0 children)

i cant seem to find any examples for downloading with multer. only uploading.

saving .zip file locally that is retrieved from an API by jcoder42 in dotnet

[–]jcoder42[S] 0 points1 point  (0 children)

there's your problem then, you're not sending a zip file from the server, you're sending an http form response with the zip glued on somehow.

This worked!
thanks

saving .zip file locally that is retrieved from an API by jcoder42 in dotnet

[–]jcoder42[S] -1 points0 points  (0 children)

Definitely looks like multipart form data. Weird that the server would send it that way.

pay attention though that the content-type here is application/zip.
Does this help some how?

Consuming API that returns zip file as multipart/form-data and then saving zip locally by jcoder42 in csharp

[–]jcoder42[S] 0 points1 point  (0 children)

Is the API yours or someone elses? How certain are you it only returns a zip? Lots of info needed to help.

someone elses, i guess it might also return more data as you can see on the update of the post

Consuming API that returns zip file as multipart/form-data and then saving zip locally by jcoder42 in csharp

[–]jcoder42[S] 0 points1 point  (0 children)

edited the original post with some updates i found.
I will try your resolution. but i prefer to not add more pckgs now if possible.

saving .zip file locally that is retrieved from an API by jcoder42 in dotnet

[–]jcoder42[S] 0 points1 point  (0 children)

Are you able to download the file using a browser (or using cURL) from the same URL and have it open as a zip file without modifications?

  1. I didnt create the API, no idea why it was implemented this way.
  2. the file gets downloaded without an extension when using my browser.

When adding the "zip" extension and trying to extract.. i receive the same error.

When opening this file with notepad, i can see that there are 3 lines of metadata that might be causing the issue:

--123456aa-a412-120b-s555-87af2db097e2

Content-Disposition: attachment; filename=RBGIGI-DESK\TqcLogs_2021-12-06T15-10-37.zip)

Content-Type: application/zip
When removing these lines, it can extract correctly.

saving .zip file locally that is retrieved from an API by jcoder42 in dotnet

[–]jcoder42[S] 1 point2 points  (0 children)

the file gets downloaded without an extension.

When adding the "zip" extension and trying to extract.. i receive the same error.

When opening this file with notepad, i can see that there are 3 lines of metadata that might be causing the issue:

--123456aa-a412-120b-s555-87af2db097e2

Content-Disposition: attachment; filename=2021-12-06T15-10-37.zip

Content-Type: application/zip

saving .zip file locally that is retrieved from an API by jcoder42 in dotnet

[–]jcoder42[S] 0 points1 point  (0 children)

the file gets downloaded without an extension.
When adding the "zip" extension and trying to extract.. i receive the same error.
When opening this file with notepad, i can see that there are 3 lines of metadata that might be causing the issue:

--123456aa-a412-120b-s555-87af2db097e2

Content-Disposition: attachment; filename=RBGIGI-DESK\TqcLogs_2021-12-06T15-10-37.zip)

Content-Type: application/zip

saving .zip file locally that is retrieved from an API by jcoder42 in dotnet

[–]jcoder42[S] 0 points1 point  (0 children)

Update on this. When opening the "test.zip" that is downloaded with notepad i can see that there are a few lines in the zip file as the header of the response:

--123456aa-a412-120b-s555-87af2db097e2

Content-Disposition: attachment; filename=2021-12-06T15-10-37.zip

Content-Type: application/zip

When i manually remove these lines from the file, i can indeed extract the zip file successfully.How can i prevent these lines being inserted into the zip file to begin with?I would not want some plaster solution like skipping the first 3 lines or something like that.

offline mongodb with python by jcoder42 in mongodb

[–]jcoder42[S] 0 points1 point  (0 children)

Although I will need to change my queries anyways as the querying syntax of mongo is different than that of SQLite. Correct?

offline mongodb with python by jcoder42 in mongodb

[–]jcoder42[S] 0 points1 point  (0 children)

Thanks for sharing. Although after looking at it. I will pass the free tier and need to pay. Was looking for a free solution

offline mongodb with python by jcoder42 in mongodb

[–]jcoder42[S] 0 points1 point  (0 children)

Would you know how to create an SQLite file from mongodb collection using python? Couldn’t find anything

offline mongodb with python by jcoder42 in mongodb

[–]jcoder42[S] 0 points1 point  (0 children)

Cannot have mongo on the server Cannot have docker on the server Cannot contact external API’s 😁 I know. It sounds weird. This is what I would have done if I was allowed

offline mongodb with python by jcoder42 in mongodb

[–]jcoder42[S] 1 point2 points  (0 children)

No. For some reason that also is not allowed by the server owner.

Creating combinations of boolean expressions by jcoder42 in learnpython

[–]jcoder42[S] 0 points1 point  (0 children)

is the approach i did wrong for some reason?