Issue #1816💬 AnsweredOpened February 20, 2019by Shah-ali0 reactions

Not allowing to upload same image on same the position after delete that image

Quick answerby artf

We have to clear the file input once the image is selected

Read full answer below ↓

Question

Ajax call which is uploading image file in assests folder It's working fine to add an image from the local. But in another scenario, It's not working. Please have a look Drag image block Select an image Delete that image Add the same image again on same the place, "uploadFile" function is not calling It's not allowing me to upload same image on same position after delete that image

Answers (3)

artfFebruary 22, 2019

We have to clear the file input once the image is selected

Shah-aliFebruary 23, 2019

Any hint please. how to clear file input?

Shah-aliFebruary 25, 2019

I think, I have fixed it. In OpenAssets.js

if (accept) {
      const uploadEl = amContainer.querySelector(
        `input#${config.stylePrefix}uploadFile`
      );
      uploadEl && uploadEl.setAttribute('accept', accept);
      uploadEl.value = "";
    }

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.