File downloads from Swagger.

1,279 views
Skip to first unread message

csmccoy

unread,
Aug 24, 2015, 3:29:44 PM8/24/15
to Swagger
I have a route that returns a csv file for download.  I'm having 2 problems.  The first is that from internet explorer the download link does nothing on click but chrome saves as expected..  If I right click save target as the file downloads fine though.  The second is the file name isn't being honored from the response.  An example is:

{
"cache-control": "no-cache",
"pragma": "no-cache",
"content-length": "8362",
"content-type": "application/csv",
"expires": "-1",
"server": "Microsoft-IIS/8.0",
"auth-token-updated": "",
"content-disposition": "attachment; filename=searchresults.csv",
"x-aspnet-version": "4.0.30319",
"x-sourcefiles": "=?UTF-8?B?YzpcV29ya1NwYWNlXENhbGxtaW5lclxEZXZlbG9wbWVudFxDYWxsTWluZXJGcm9udEVuZEFwaVx0cnVua1xzcmNcQ2FsbE1pbmVyRnJvbnRFbmRBcGlcYXBpXHYyXGV4cG9ydA==?=",
"x-powered-by": "ASP.NET",
"date": "Mon, 24 Aug 2015 16:03:58 GMT",
"": ""
}

yet saves as 7F4E1DD6-C74B-481E-82F9-3A222327949C with no extension in IE and chrome as application-csv-export-guid=2299f2da-1e86-4fc1-aab4-6fdc776b5715-blob-http%3A--localhost%3A21346-40f3b67c-56ff-4112-9381-1cada346c2be.  This only recently started happening after we added a new version to our api.  Previously this was working fine.

Using Swagger version v2.1.2-M2.

Ron Ratovsky

unread,
Aug 25, 2015, 6:56:33 AM8/25/15
to Swagger
Can you try it again with the latest version of the UI?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

csmccoy

unread,
Aug 25, 2015, 9:13:04 AM8/25/15
to Swagger
Good morning Ron,

I'll give that a go.  Was hoping to avoid it right now as I have made a lot of changes to the UI for our implementation.  If I have any other problems I'll make another post.

Chris


On Tuesday, August 25, 2015 at 6:56:33 AM UTC-4, Ron wrote:
Can you try it again with the latest version of the UI?
On Mon, Aug 24, 2015 at 10:29 PM, csmccoy <christop...@gmail.com> wrote:
I have a route that returns a csv file for download.  I'm having 2 problems.  The first is that from internet explorer the download link does nothing on click but chrome saves as expected..  If I right click save target as the file downloads fine though.  The second is the file name isn't being honored from the response.  An example is:

{
"cache-control": "no-cache",
"pragma": "no-cache",
"content-length": "8362",
"content-type": "application/csv",
"expires": "-1",
"server": "Microsoft-IIS/8.0",
"auth-token-updated": "",
"content-disposition": "attachment; filename=searchresults.csv",
"x-aspnet-version": "4.0.30319",
"x-sourcefiles": "=?UTF-8?B?YzpcV29ya1NwYWNlXENhbGxtaW5lclxEZXZlbG9wbWVudFxDYWxsTWluZXJGcm9udEVuZEFwaVx0cnVua1xzcmNcQ2FsbE1pbmVyRnJvbnRFbmRBcGlcYXBpXHYyXGV4cG9ydA==?=",
"x-powered-by": "ASP.NET",
"date": "Mon, 24 Aug 2015 16:03:58 GMT",
"": ""
}

yet saves as 7F4E1DD6-C74B-481E-82F9-3A222327949C with no extension in IE and chrome as application-csv-export-guid=2299f2da-1e86-4fc1-aab4-6fdc776b5715-blob-http%3A--localhost%3A21346-40f3b67c-56ff-4112-9381-1cada346c2be.  This only recently started happening after we added a new version to our api.  Previously this was working fine.

Using Swagger version v2.1.2-M2.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Vi

unread,
Jan 6, 2016, 10:24:53 AM1/6/16
to Swagger
I'm having the same issue even after updating to the latest version of the UI. Were you able to resolve this?

csmccoy

unread,
Jan 6, 2016, 10:43:23 AM1/6/16
to Swagger
No I haven't resolved it yet.  I still haven't updated our implementation to the newest version; probably won't for a couple more months yet as it was decided this was a low priority.

Chris
Reply all
Reply to author
Forward
0 new messages