fix for file storing in webdav

This commit is contained in:
Kyle Drake 2015-11-11 11:30:38 -08:00
parent 74c65cf680
commit 7ea3935571

View file

@ -35,7 +35,7 @@ map '/webdav' do
end end
if Site.valid_file_type?(filename: path, tempfile: tmpfile) if Site.valid_file_type?(filename: path, tempfile: tmpfile)
site.store_file path, tmpfile site.store_files [{filename: path, tempfile: tmpfile}]
return [201, {}, ['']] return [201, {}, ['']]
else else
return [415, {}, ['']] return [415, {}, ['']]
@ -51,7 +51,7 @@ map '/webdav' do
FileUtils.cp site.files_path(env['PATH_INFO']), tmpfile.path FileUtils.cp site.files_path(env['PATH_INFO']), tmpfile.path
DB.transaction do DB.transaction do
site.store_file destination, tmpfile site.store_files [{filename: destination, tempfile: tmpfile}]
site.delete_file env['PATH_INFO'] site.delete_file env['PATH_INFO']
end end