[BUG] Asset Manager sends empty request when uploading image
Question
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
Answers (3)
What about the client-side? Do you see the upload request correctly (eg. from the inspector)?
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.
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.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #507
uploadFile being called twice on drop file?
I have an editor initialized as so: If I add an image to the canvas and try to upload a new image by dragging it into the drop area in the...
Issue #384
Create and Edit Template into Database
This is my code to Create a new template and insert the inline html with style into the database : I am able to insert the template-data in...
Issue #1988
bug on resize image
Hi ! I have some issues when i want resize an image. When i put an image and when i click one resizer handler, the image don't keep his hei...
Issue #1468
[bug] modaltitle no effect
Hello, I can't translate asset manager title to french. Example : assetManager: { storageType: '', storeOnChange: true, storeAfterUpload: t...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.