Wysiwyg-editor: Disable Image/File drag-drop and upload feature

Created on 19 May 2015  路  15Comments  路  Source: froala/wysiwyg-editor

I am using froala 1.2.7 and want to disable the image/file drag and drop and upload functionality for my app.
I tried setting options 'imageUpload' and 'pasteImage' to false, but the features were not disabled. Anything I am missing here?

Most helpful comment

In V2, the option names are different:

  • pageImage is imagePaste
  • imageUpload was remove and $.FroalaEditor.POPUP_TEMPLATES.imageInsert should be changed instead
  • imageInsertButtons should be changed as well

All 15 comments

If you don't want to upload files, you should simply not include the File Upload plugin. There was a problem and setting pasteImage to false together with imageUpload was not working. Last commit fixes that.

I'm facing the same difficulty than ishaaggarwal with Froala v2.0.5, the File Upload plugin is not included, 'pasteImage' & 'imageUpload' are set to 'false'. But the features are not disabled...

Here my settings :

$('[data-editable-type="full"]').froalaEditor({
toolbarInline: true,
placeholderText: null,
imageUpload: false,
pasteImage: false,
toolbarButtons: ['bold','italic','formatUL','formatOL','|','insertLink','|','insertImage','insertVideo','emoticons']
})

Maybe I do something wrong ?

In V2, the option names are different:

  • pageImage is imagePaste
  • imageUpload was remove and $.FroalaEditor.POPUP_TEMPLATES.imageInsert should be changed instead
  • imageInsertButtons should be changed as well

Yes it works ! Thank you stefanneculai

Hi,
I face the same question. I just want to let the url to allow inserting an image. I'm using V2.
I set the imagePaste to false.
I set the buttons correctly.

But if I drag and drop an image in the editor an image still got uploaded (to froala.com since I've not set the upload url). I drop an image directly on the froala form not in the section for image.

@nicolasbocquet can you confirm what you've done?
@stefanneculai can you be explain what you mean by $.FroalaEditor.POPUP_TEMPLATES.imageInsert should be changed instead

Thanks!

@lebart using image.beforeUpload event should help.

@stefanneculai Thanks for your answer.
If I set something like
.on('froalaEditor.image.beforeUpload', function (e, editor, images) { return false })

The editor shows the uploading progression bar and never stops. Can I do something better?

I think a good enhancement would be an option to select easily the way we allow images to be added.
imageInsertingStrategy: "url |聽upload | both"
imageAllowDragAndDrop: "false | true"
Should I add an Issue to tag this as enhancement?

@stefanneculai returning 'false' in the image.beforeUpload event will also disable the image being added to the editor.

Is there a way to prevent the upload but still keep the functionality of adding to the editor?

I came across this page when searching for a way to disable image uploads in the froala editor. I was able to disable the feature by setting "allowedImageTypes" to an empty array. As far as I can tell, there are no other adverse effects from this change.

I apologize in advance but I have some the uncomfortable bug.
I put my redactor into the popup , and make next actions:
1) I open popup
2) open dialog for adding files
3) click cancel
4) close popup
5) open popup again
6) click ''Upload files btn"
7) and then trying to click on the popup that was showing, but it is closing and nothing is happens
Also, I see that at first opening the popup , it adds tasks for click event into a listener, But at second opening it's not happening.
Can somebody tell me , what it can be?

If that will help anyone, looking at the source of image plugin, we find the following default setting

$.FE.DEFAULTS.imageInsertButtons = ['imageBack', '|', 'imageUpload', 'imageByURL'];

so to disable imageUpload, you can simply override the previous object to

$.FE.DEFAULTS.imageInsertButtons = ['imageBack', '|', 'imageByURL'];

and of course to enable imageByURL

$.FE.DEFAULTS.imageInsertButtons = ['imageBack', '|', 'imageUpload'];

Contrary to the comment made up above, not including the plugin (image.min.js) worked for me in disabling image upload

@anasnakawa thanks, I applied your solution to disabling the video upload tab, and it worked perfectly!

Can someone please provide a codepen example of this. I wish to remove the upload image functionality but am unclear how this is done...

@angusgrant you can easily do that by changing the imageInsertButton option and remove imageUpload from it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fandangi picture Fandangi  路  3Comments

rogersteblerbsi picture rogersteblerbsi  路  3Comments

archonic picture archonic  路  4Comments

isubasti picture isubasti  路  4Comments

george-norris-salesforce picture george-norris-salesforce  路  4Comments