GithubHelp home page GithubHelp logo

browsermedia / bcms_webdav Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.45 MB

A BrowserCMS module to allow access to site content via webdav.

License: GNU Lesser General Public License v3.0

Ruby 97.69% JavaScript 2.31%

bcms_webdav's People

Contributors

peakpg avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bcms_webdav's Issues

500 in production

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:infor'
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:input'
dav4rack (0.2.11) lib/dav4rack/resource.rb:116:in method_missing' dav4rack (0.2.11) lib/dav4rack/controller.rb:83:input'
dav4rack (0.2.11) lib/dav4rack/handler.rb:30:in call' bcms_webdav (2.0.0) lib/bcms_webdav/web_dav_middleware.rb:20:incall'
.....

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.