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

The right filename for downloaded feeds #3

Open
zbouziane opened this issue Mar 7, 2017 · 5 comments
Open

The right filename for downloaded feeds #3

zbouziane opened this issue Mar 7, 2017 · 5 comments
Assignees

Comments

@zbouziane
Copy link
Member

The download request '/api/manager/downloadfeed/${token}' when succeeding return a zip file with a randomly generated name. In the response header there is "Content-Disposition: attachment; filename=test4474876194626471181.zip". Is it possible to return the right filename instead?

@landonreed landonreed self-assigned this Mar 8, 2017
@landonreed
Copy link
Member

landonreed commented Mar 8, 2017

Hmm... I'm not seeing this when downloading a feed version @zbouziane. Could you be more specific about for which downloads this is occurring?

@zbouziane
Copy link
Member Author

Below the download traces with our dev server. I don't know where do the name "test6434875078538668874.zip" comes from. The server returns it.

➜ ~ curl -v -X GET http://catalogue.tdvdigitalfactory.ovh/api/manager/public/feedversion/mYdata_20170223T140612Z_cd066f71-94a4-44b1-8e12-96da0a00e82d.zip/downloadtoken
Note: Unnecessary use of -X or --request, GET is already inferred.

  • Trying 178.33.231.17...
  • TCP_NODELAY set
  • Connected to catalogue.tdvdigitalfactory.ovh (178.33.231.17) port 80 (#0)

GET /api/manager/public/feedversion/mYdata_20170223T140612Z_cd066f71-94a4-44b1-8e12-96da0a00e82d.zip/downloadtoken HTTP/1.1
Host: catalogue.tdvdigitalfactory.ovh
User-Agent: curl/7.51.0
Accept: /

< HTTP/1.1 200 OK
< Server: nginx/1.8.1
< Date: Thu, 09 Mar 2017 09:47:33 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Headers: Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin,
< Content-Encoding: gzip
<

  • Curl_http_done: called premature == 0
  • Connection #0 to host catalogue.tdvdigitalfactory.ovh left intact
    {"id":"6f1c187d-fcd9-41c2-a997-6e73014ff995","valid":true,"project":null,"feedVersion":{"id":"mYdata_20170223T140612Z_cd066f71-94a4-44b1-8e12-96da0a00e82d.zip","updated":1487858772942,"version":1,"name":"02/23/2017 14:06 Upload","fileSize":1883153,"fileTimestamp":1488902641000,"noteCount":0,"feedSource":{"id":"cd066f71-94a4-44b1-8e12-96da0a00e82d","projectId":"825deea6-446a-4fd3-bad7-a34bb7b813c7","regions":["1"],"name":"mYdata","isPublic":true,"deployable":false,"retrievalMethod":"MANUALLY_UPLOADED","lastFetched":null,"url":null,"snapshotVersion":null,"latestVersionId":"mYdata_20170223T140612Z_cd066f71-94a4-44b1-8e12-96da0a00e82d.zip","lastUpdated":1487858772942,"latestValidation":{"loadStatus":"SUCCESS","loadFailureReason":null,"agencies":["OCENI","OCESN"],"errorCount":4047,"agencyCount":2,"routeCount":922,"tripCount":16754,"stopTimesCount":149602,"startDate":1483315200000,"endDate":1491091200000,"bounds":{"west":-4.47891795,"south":21.25950778,"east":38.23488429,"north":82.23698068}},"editedSinceSnapshot":false,"externalProperties":{"TRANSITFEEDS":{},"TRANSITLAND":{}},"feedVersionCount":1,"noteCount":0,"user":null},"previousVersionId":null,"nextVersionId":null,"validationSummary":{"loadStatus":"SUCCESS","loadFailureReason":null,"agencies":["OCENI","OCESN"],"errorCount":4047,"agencyCount":2,"routeCount":922,"tripCount":16754,"stopTimesCount":149602,"startDate":1483315200000,"endDate":1491091200000,"bounds":{"west":-4.47891795,"south":21.25950778,"east":38.23488429,"north":82.23698068}},"user":null},"user":null}

➜ ~ curl -v -X GET http://catalogue.tdvdigitalfactory.ovh/api/manager/downloadfeed/6f1c187d-fcd9-41c2-a997-6e73014ff995 > result.zip
Note: Unnecessary use of -X or --request, GET is already inferred.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 178.33.231.17...

  • TCP_NODELAY set
  • Connected to catalogue.tdvdigitalfactory.ovh (178.33.231.17) port 80 (#0)

GET /api/manager/downloadfeed/6f1c187d-fcd9-41c2-a997-6e73014ff995 HTTP/1.1
Host: catalogue.tdvdigitalfactory.ovh
User-Agent: curl/7.51.0
Accept: /

< HTTP/1.1 200 OK
< Server: nginx/1.8.1
< Date: Thu, 09 Mar 2017 09:49:07 GMT
< Content-Type: application/octet-stream
< Transfer-Encoding: chunked
< Connection: keep-alive
< Content-Disposition: attachment; filename=test6434875078538668874.zip
<
{ [3905 bytes data]
100 3898 0 3898 0 0 3727 0 --:--:-- 0:00:01 --:--:-- 3730* Curl_http_done: called premature == 0
100 1839k 0 1839k 0 0 1507k 0 --:--:-- 0:00:01 --:--:-- 1507k

  • Connection #0 to host catalogue.tdvdigitalfactory.ovh left intact

@landonreed
Copy link
Member

@zbouziane what version of datatools-server are you running?

@zbouziane
Copy link
Member Author

https://github.com/conveyal/datatools-manager.git

branch : master

commit fe29528
Author: Landon Reed [email protected]
Date: Wed Sep 28 18:49:51 2016 -0400

better handle pasted rows in timetables

@landonreed
Copy link
Member

@zbouziane, I think we should try to get your instance migrated to the latest dev version. I think this should fix the issue you're encountering. The latest dev docs has a directions on migration.

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