browsermedia / bcms_webdav Goto Github PK
View Code? Open in Web Editor NEWA BrowserCMS module to allow access to site content via webdav.
License: GNU Lesser General Public License v3.0
A BrowserCMS module to allow access to site content via webdav.
License: GNU Lesser General Public License v3.0
Installed 2.0.0, in development all works fine, in production after all necessary configurations it breaks at
bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:192:in `extract_tempfile'
Here is the full log:
Paperclip::AdapterRegistry::NoHandlerError (No handler found for #<PhusionPassenger::Utils::RewindableInput:0xb6a8b54 @io=#<PhusionPassenger::Utils::UnseekableSoc
ket:0xc07de90 @socket=#<UNIXSocket:fd 12>>, @rewindable_io=nil, @unlinked=false>):
paperclip (3.0.4) lib/paperclip/io_adapters/registry.rb:19:in handler_for' paperclip (3.0.4) lib/paperclip/io_adapters/registry.rb:29:in
for'
bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:192:in extract_tempfile' bcms_webdav (2.0.0) lib/bcms_webdav/resource.rb:137:in
put'
dav4rack (0.2.11) lib/dav4rack/resource.rb:116:in method_missing' dav4rack (0.2.11) lib/dav4rack/controller.rb:83:in
put'
dav4rack (0.2.11) lib/dav4rack/handler.rb:30:in call' bcms_webdav (2.0.0) lib/bcms_webdav/web_dav_middleware.rb:20:in
call'
.....
Found the fix (http://stackoverflow.com/questions/15172439/paperclip-and-phusion-passenger-nohandlererror):
The example you're cribbing from expects the file stream to be a StringIO object, but Passenger is giving you a PhusionPassenger::Utils::RewindableInput object instead.
Fortunately, a RewindableInput is duckalike to StringIO for this case, so Paperclip's StringioAdapter can be used to wrap your upload stream.
Inside the if block in your parse_raw_upload, at the end, do:
if @raw_file.class.name == 'PhusionPassenger::Utils::RewindableInput'
@raw_file = Paperclip::StringioAdapter.new(@raw_file)
end
In my project overwrote the Resource file,put it in initializer. Updated extract_tempfile method and changed line 192 to be:
if request.body.class.name == 'PhusionPassenger::Utils::RewindableInput'
uploaded_file = Paperclip::StringioAdapter.new(request.body)
else
uploaded_file = Paperclip.io_adapters.for(request.body)
end
Was able to move my files after that.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.