Skip to content
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

setResult doesn't return a file #14

Open
moorthi07 opened this issue Dec 16, 2017 · 3 comments
Open

setResult doesn't return a file #14

moorthi07 opened this issue Dec 16, 2017 · 3 comments

Comments

@moorthi07
Copy link
Member

moorthi07 commented Dec 16, 2017

How to return a file from Deployd?
Neither of these work.

ctx.res.setHeader('Content-Type', 'application/zip');
ctx.res.end(fs.readFileSync(filePath));
or
setResult(fs.readFileSync(filePath));

@andreialecu
Copy link
Contributor

andreialecu commented Dec 16, 2017

setResult() should work, but you also need to specify the proper mime type.

You can do that via setHeader('Content-Type', 'your/mime-type') once deployd/deployd#851 is merged and released.

Edit: Make sure you're using the just released version ^1.0.0

@moorthi07
Copy link
Member Author

Just edited the issue. Yes. I tried with ctx.res.setHeader('Content-Type', 'application/zip'); didn't work.

Problem with Deployd is , it restricts some of the basic features of Nodejs like this one and request.On - because of the ctx wrapper .

@andreialecu
Copy link
Contributor

This should work now with deployd ^1.1.2 and dpd-event ^1.1.1.

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

2 participants