Jump to content
Juri

Front-End Editing direct Image Upload

Recommended Posts

Hello,

in the Backend I can directly drag & drop an image into an textarea and it gets uploaded.

In frontendediting the uploading seems to work, but then I get the message "Incorrect server response." and the image disapears and also is not uploaded at all.

Using the Image Button and Upload and select the image in the modal works. I disabled all scripts and styles, but the issue still persists.

I wonder if this could be an issue of my server since the direct upload works in backend.

thanks, juri

Edit: In the console I see that the responding result is html and the error output links to https://ckeditor.com/docs/ckeditor4/latest/guide/dev_errors.html#filetools-response-error

image.thumb.png.36d2f0c8b25386e958d3487f970040b2.png

Share this post


Link to post
Share on other sites

Direct upload in the frontend via drag-and-drop never worked for me, and afaik it's not supposed to work (same as copy and paste an image, which works in BE, but not FE).

Share this post


Link to post
Share on other sites

I'm not really sure if this will lead you to something or nothing, but have you tried using a compatible jquery version in the FE? The PW BE uses jquery 1.11.1 with a migrate version 1.2.1 but in my testing jquery ver 2.2.4 worked too.

It works for me using something like the following:

echo "<div edit='",$input->get->id,".images' >","<a>dbl-click to edit</a></div>";

$scripts = "<script type='text/javascript'>" .
    "$(document).on('pw-modal-closed', '.pw-edit-modal', function() {" .
    "var saveButton = document.getElementById('button_save');" .
    "saveButton.click();" .
    "});" .
    "</script>";

$jquery_version = "2.2.4";

Then in my main template I add that jquery variable because for regular FE pages, I use another jquery version. 

<script>window.jQuery || document.write('<script src="<?php echo $config->urls->skin, "js/jquery-{$jquery_version}.min.js"; ?>"><\/script>')</script> 

 

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...