Skip to content

codegen web generate handler only returns zip file name and not content #112

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

Closed
auahmed opened this issue Mar 9, 2018 · 9 comments
Closed
Assignees

Comments

@auahmed
Copy link

auahmed commented Mar 9, 2018

If the handler is used as a service and hosted somewhere for people to visit and access via a website, the request should return the actual zip file itself rather then the file name as the user might not have access to the server.
Currently the file is placed into /tmp/zip looking at the default config directory settings.

@stevehu
Copy link
Contributor

stevehu commented Mar 10, 2018

My original thought was to generate the file and put it into /tmp/zip and then return the filename to the caller. If we have a single page application that renders the UI, it can display the link on the browser to allow user to download. Returning zip file directly will work but I guess the end user must choose a filename to save locally. I think both approach should work and we just need to pick up one that is easier. What do you think? Do you want to try it to return zip file content? Thanks.

@DSchrupert
Copy link
Member

@stevehu I can take a look at this if no one has already?

@stevehu
Copy link
Contributor

stevehu commented Mar 17, 2018

@NicholasAzar Yes. Please do. Thanks.

@auahmed
Copy link
Author

auahmed commented Mar 21, 2018

hi @NicholasAzar , was wondering if the issue was fixed?
i had pulled the new code locally and built the project but it seems like sending the request with /api/zip in the path it does not go into the handler. i get no response back and the following is what i see in the console:

11:48:53.111 [XNIO-1 task-10]  V1SYtN9zSHKTRGvIxM0Rmg DEBUG io.undertow.request match - Matched default handler path /api/zip

wanted to confirm if it was fixed and if possible would you might know why i might not be getting a response.

@DSchrupert
Copy link
Member

@auahmed yeah it was working for me when i finished. I think you just need to make sure what you have installed is the latest from develop. Double check to see if your local light, light-hybrid, and light-codegen (in that order) are both on develop with latest pulled, and installed. If that doesn't solve the problem i'll spend more time trying to recreate the issue.

@auahmed
Copy link
Author

auahmed commented Mar 22, 2018

Thanks @NicholasAzar !!! i guess i hadn't built it in the right order and cuz of that it did not work before.
Worked now and everything looks great

@auahmed
Copy link
Author

auahmed commented Mar 23, 2018

@NicholasAzar was there a specific reason you switched from using axios to form for the download button?

@DSchrupert
Copy link
Member

@auahmed it was only since I already knew file download from a form and didn't want to risk going down a rabbit hole 😄
In hindsight though, i should have stuck with an ajax request since i realized too late that the response is not necessarily a file.
I'll be making the change to revert back to axios.

@stevehu
Copy link
Contributor

stevehu commented Apr 3, 2018

This is released along with version 1.5.11

@stevehu stevehu closed this as completed Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants