Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Provide the callback with relative path of files when uploading folders #78

merged 3 commits into from

2 participants


I'm writing an app where I need to be able to upload folders and reconstruct the folder hierarchy in my app. I added support for this by adding a "relativePath" parameter to the callback POST.

Note, while these are 3 commits, the third is reverting the first one so it is only the middle commit that contains the actual change.

P.S. I've only tested this on Chrome.


Interesting. I wasn't aware that it was possible to upload entire folders.

@waynehoover waynehoover merged commit 01d01e5 into waynehoover:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 0 deletions.
  1. +8 −0 app/assets/javascripts/
8 app/assets/javascripts/
@@ -115,9 +115,17 @@ $.fn.S3Uploader = (options) ->
content.filesize = file.size if 'size' of file
content.filetype = file.type if 'type' of file
content.unique_id = file.unique_id if 'unique_id' of file
+ content.relativePath = build_relativePath(file) if has_relativePath(file)
content = $.extend content, settings.additional_data if settings.additional_data
+ has_relativePath = (file) ->
+ file.relativePath || file.webkitRelativePath
+ build_relativePath = (file) ->
+ file.relativePath || (file.webkitRelativePath.split("/")[0..-2].join("/") + "/" if file.webkitRelativePath)
#public methods
@initialize = ->
Something went wrong with that request. Please try again.