Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to use local image upload in wysiwyg editor #1069

Closed
tomasztunik opened this issue Feb 17, 2015 · 10 comments
Closed

Add ability to use local image upload in wysiwyg editor #1069

tomasztunik opened this issue Feb 17, 2015 · 10 comments
Assignees

Comments

@tomasztunik
Copy link
Contributor

I was able to hack it in by modifying wysiwyg additional options property and fooling keystone to think it's using cloudinary images but it would be great to have a native way to do that. We'd probably need a destination and flag to decide if we want to hash the name or retain original filename. Can't come up with easy way to link the images to the document that would use it unless we extended field's schema to also include additional field for storing image references if user have chosen to use wysiwyg local images (or whatever it would be called) that would get updated if image is added, removed or would be used to remove images if entry is removed.

Had to create custom api endpoint to handle the uploads - if anybody needed that for the time being let me know. And there goes the hack :)

keystone.init({
  ...
  'cloudinary config': { cloud_name: 'not', api_key: 'really', api_secret: 'used' },
  'wysiwyg cloudinary images': true,
  'wysiwyg additional options': {
    'uploadimage_form_url': '/api/admin/upload-image'
  }
});
@adamscybot
Copy link

+1

@rclark72
Copy link
Contributor

+1, this one is related to #526

@jeffreypriebe
Copy link
Contributor

+1
@tomasztunik Do you have hacked code somewhere available for others to use?

@mariohmol
Copy link

This is a very good solution for wysiwyg and image managment keystonejs/keystone#1549 (comment)

@vijaychow7
Copy link

Getting "Got a bad response from the server" after clicking on insert button. Do we need to do any other changes?

@HACKVTT
Copy link

HACKVTT commented Apr 28, 2016

+1
keystone.init({
...
'cloudinary config': { cloud_name: 'not', api_key: 'really', api_secret: 'used' },
'wysiwyg cloudinary images': true,
});

But below code I add
'wysiwyg additional options': {
'uploadimage_form_url': '/api/admin/upload-image'
}

==> Result: Got a bad response from the server

@andrewlinfoot
Copy link
Contributor

We're closing all feature requests to keep the issue tracker unpolluted. I've moved this to ProductPains: https://productpains.com/post/keystonejs/add-ability-to-use-local-image-upload-in-wysiwyg-editor

@quadrifoliumclover
Copy link

@tomasztunik can you share you api endpoint handler code somehow, please?

@christroutner
Copy link
Contributor

@quadrifoliumclover you should check out ConnextCMS. It's built on top of KeystoneJS and it allows inserting of localy hosted images with the TinyMCE editor.

You can view the source code on GitHub. I ended up having to write a new plugin for TinyMCE.

@VoronV48
Copy link

VoronV48 commented Aug 30, 2022

in answer set header

`

res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.send({"image":{"url":"url you picture"}});
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests