Open springmeyer opened 12 years ago
This is going to be bit of a chicken and egg problem since we don't validate the filesize until the map is created and we can't create the map until the upload is complete.
maybe a workaround would be to report the storage remaining somewhere on the export page, so a user could get a rough sense - say that they have 100 MB remaining but their export is 3 GB. Though I guess then a sync vs new upload would need to be taken into account (#1394)
@willwhite - has anything changed here? This would be really great to fix: https://twitter.com/zeke/status/280419877364310016 /cc @zeke
@willwhite - what about TileMill doing a file stat before uploading (but after export) and sending a initial check to hosting to see if it will fit?
Yep I've thought a bit about this. Upload credentials could be issued with an oauth request like:
https://tiles.mapbox.com/api/Upload/:account?access_token=:token
We could add something like:
https://tiles.mapbox.com/api/Upload/:account?access_token=:token&filesize=:size&id=:mapid
Where :size
is the file's size in bytes. If the file won't fit, an error will be returned instead of credentials. The :mapid
can be used for replacing existing maps, where the size of the exiting map needs to be removed from the total.
Would that work?
Sounds promising. Ideally if the file will not fit the export could be kept around so the user can try uploading it again. To make this easier we might want to consider making an "upload" appear as both an mbtiles export plus a separate upload export.
Thanks for the CC. Let me know if I can help by building TileMill and trying out the feature!
In the case of an upload error from hosting of "No storage space remaining" it would be great to trigger this before the upload wait.