You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't want to make a pull request out of this yet, but I hacked the current uploader to allow for documents to be uploaded:
Basically it extends the current functionality by checking if the uploaded file is an image, and if it isn't, use the new code.
The server has to give back an extra value, called "response.document.img".
When the user has text selected and uploads a document, the selected text is converted to a link
If there is an image in the selection, that image is wrapped in a link to the document.
If there is no selection, a new image is used with the src set to response.document.img, on the server side I then check for the mime type and pass back the appropriate image url, for example a small PDF image, or Word image.
This needs a lot of work, and it would be best to extract this out into a separate image uploader and document uploader (because the image previewing feature (during uploading) now shows a broken image), but I don't think I am comfortable with the code yet to do this and I definitely won't have the time for the next few weeks.
I've been playing around with a plugin architecture.. and in doing so I've broken some image cropping/resizing features into that plugin -- I'd like to pull this into that plugin as well to see how easily all of this can be accomplished in a plugin. It'll fit right in with it since it's an "advanced uploader" plugin.
Is there any way to get a sneak preview at this plugin architecture? I'm currently working on a site where I'd like to do audio uploads which would require some handling by my apps Rails controllers and I'd like to see if this could integrate with this Mercury plugin concept.
I'm seconding milgner's request. It would be nice if we could see this code in context. I am trying to add a document uploader for a project I'm working on....
I didn't want to make a pull request out of this yet, but I hacked the current uploader to allow for documents to be uploaded:
Basically it extends the current functionality by checking if the uploaded file is an image, and if it isn't, use the new code.
src
set toresponse.document.img
, on the server side I then check for the mime type and pass back the appropriate image url, for example a small PDF image, or Word image.This needs a lot of work, and it would be best to extract this out into a separate image uploader and document uploader (because the image previewing feature (during uploading) now shows a broken image), but I don't think I am comfortable with the code yet to do this and I definitely won't have the time for the next few weeks.
Anyway, here is the snippet:
The text was updated successfully, but these errors were encountered: