Replies: 2 comments 2 replies
-
|
You can do it the hard way by just pasting this into every action $tx->res->headers->content_type("application/vnd.fdf") |
Beta Was this translation helpful? Give feedback.
-
|
I think I figured it out. I originally had 'app->types->type($Format => "application/$Format")' instead of 'app->types->type($Format => ["application/$Format"])' in the example, but after posting the question I read the documentation and looked at the source code (all the defaults use the array version) and tried the new version. It didn't appear to work, but after restarting the server (apache) again this morning it seems to have worked. If I am reading the documentation correctly, which is difficult for me to do, I don't understand why you would want an array of mime types there and it shouldn't make a difference, but apparently it does. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I know setting the MIME type returned is supposed to be super easy but I can't seem to get it to work. I am working with fillable PDFs so I need to return data as "application/vnd.fdf". The code I have is:
It is kind of a black box because the request is coming from and being handled by Acrobat Reader when viewing a PDF, but it was working correctly when I was using stock plack and it is not since I switched to mojolicious. Instead of my custom message Acrobat is generating a stock message that the submission "succeeded" (that is not helpful because it actually may fail validation) which I guess means the status is being returned at least. Is there any way to bypass the super easy method and "hard code" the mime type?
Any help would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions