GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.38k stars 4.06k forks source link

[BUG] Asset Manager sends empty request when uploading image #998

Closed tonygiang closed 6 years ago

tonygiang commented 6 years ago

Description: GrapesJS editor is initialized in an editor.html file as follows:

  var editor = grapesjs.init({
    container: '#gjs',
    height: '100%',
    fromElement: true,
    plugins: ['gjs-preset-newsletter'],
    assetManager: {
      autoAdd: 1,
      upload: 'http://localhost:9001/uploadimage.php',
      uploadName: 'upload',
    },
  });

localhost:9001 is a local IIS server running PHP5. The content of uploadimage.php is as follows:

<?php
$logfile = fopen("testlog.txt", "a+");
$req_dump = print_r($_FILES, TRUE);
fwrite($logfile, $req_dump . PHP_EOL);
fclose($logfile);

Since images uploaded from GrapesJS is expected to be in the $_FILES array, I dump all of its content to a log file everytime a request reaches this page. The testlog.txt file always gets

Array
(
)

each time I upload an image from the Image element found in gjs-preset-newsletter plugin, indicating that Asset Manager is sending empty requests to the server. File upload is enabled in my php.ini:

file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20

And the test image file is way below PHP's limit. To be exact, I used GitHub_Logo.png found in a package here for testing. Am I doing something wrong?

OS: Windows 10 GrapesJS version: v0.14.6 Browser: Chrome 65

artf commented 6 years ago

What about the client-side? Do you see the upload request correctly (eg. from the inspector)?

no-response[bot] commented 6 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.