View Issue Details

This issue affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
19193Bug reportsPluginspublic2023-10-26 11:59
Reporterleemgs Assigned Totibor.pacalat  
PrioritynoneSeverityminor 
Status closedResolutionduplicate 
Product Version6.2.x 
Summary19193: How To Upload Image File On Chrome Brwoser
Description

I tried to upload a file in Chrome browser and it failed. The file is not uploaded and only JSON information is displayed in the browser as shown below.

  1. Log message
    { "success":true,"size":267.296875,"name":"sad-engineer.jpg","ext":"jpg","filename":"futmp_haxrm97kawpk9b5_jpg","msg":"The file has been successfully uploaded." }

On the other hand, when I use the Edge browser and Firefox, the file upload works fine.

What can I do to resolve this issue?

  1. How to reproduce the issue (Temporal links):
    2.1. Limesurvey demo, admin mode - demo.limesurvey.org/index.php?r=surveyAd...iew&iSurveyID=768633
    2.2. Limesurvey demo, user mode -
    demo.limesurvey.org/index.php?r=survey/i...8633/gid/78/qid/2446
    demo.limesurvey.org/index.php?r=survey/index&sid=768633&lang=en

  2. Debug messages:
    I analyzed the cause of files not being uploaded properly when trying to upload files in the Chrome browser.
    Below are the debugging and log messages I collected.
    In summary, when performing the file upload function in the Chrome browser, the JavaScript function called currentUploadHandler is not performing properly.

3.1. Chrom browser, debug message, VM349
VM349:1 Uncaught TypeError: Cannot read properties of null (reading 'removeChild')
at removeNode (<anonymous>:1:1874)
at HTMLIFrameElement.<anonymous> (<anonymous>:1:6347)

limesurvey-file-upload-err.JPG

3.2. JavaScript error occurs::
window.currentUploadHandler=new uploadHandler(e,t),window.currentUploadHandler.init(),window.currentUploadHandler}}))

!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict"function(){function addEvent(e,t,a){if(e.addEventListener)e.addEventListener(t,a,!1);else{if(!e.attachEvent)throw new Error("not supported or DOM not loaded");e.attachEvent("on"+t,(function(){a.call(e)}))}}if(document.documentElement.getBoundingClientRect)var getOffset=function(e)............................0!=s&&n<s&&showpopups?!!confirm(uploadLang.errorNeedMoreConfirm.replace("%s",s-n))&&l(e,t,a,i),!0)l(e,t,a,i),!0)}}};function escapeHtml(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}window.getUploadHandler=function(e,t){return window.currentUploadHandler=new uploadHandler(e,t),window.currentUploadHandler.init(),window.currentUploadHandler}}));
//# sourceMappingURL=uploadquestion.min.js.map

3.3. Storage device file folder part, corresponding temporary file area:
invain@ubuntu:/var/www/html/survey$
invain@ubuntu:/var/www/html/survey$ grep -R "sourceMappingURL=uploadquestion.min.js.map" ./ | more
./assets/packages/questions/upload/build/uploadquestion.min.js://# sourceMappingURL=uploadquestion.min.js.map
./tmp/assets/c23a8689/build/uploadquestion.min.js://# sourceMappingURL=uploadquestion.min.js.map
./tmp/assets/bb996b00/build/uploadquestion.min.js://# sourceMappingURL=uploadquestion.min.js.map
./tmp/assets/da14ce5a/build/uploadquestion.min.js://# sourceMappingURL=uploadquestion.min.js.map
invain@ubuntu:/var/www/html/survey$
invain@ubuntu:/var/www/html/survey$

BRs,
Geunsik Lim.

Steps To Reproduce

Steps to reproduce

  1. Open chrome browser
  2. Create the file upload function in a survey
  3. Try to upload a file (e.g., .jpg)

Expected result

We can see the uploaded file information from the pop-up window.

Actual result

We got the the below json messages on chrome browser unexpectedly.
{ "success":true,"size":267.296875,"name":"sad-engineer.jpg","ext":"jpg","filename":"futmp_haxrm97kawpk9b5_jpg","msg":"The file has been successfully uploaded." }

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)LimeSurvey Community Edition Version 6.2.6+230904
I will donate to the project if issue is resolvedYes
BrowserChrome Browser (Version 118.0.5993.71 64bit)
Database type & versionMySQL 8.0.34-0ubuntu0.22.04.1 for Linux on x86_64
Server OS (if known)Ubuntu 22.04 LTS (64bit)
Webserver software & version (if known)Apache 2.4.52-1ubuntu4.4
PHP VersionPHP 8.1.2-1ubuntu2.14
Git branch / Pull Request URL

Relationships

duplicate of 19192 closedtibor.pacalat How To Upload Image File On Chrome Brwoser 

Users monitoring this issue

There are no users monitoring this issue.

Activities

tibor.pacalat

tibor.pacalat

2023-10-25 12:07

administrator   ~77969

I can not reproduce this using Chrome 118, Limesurvey 6.2.6+230904, PHP 8.1.4.

Can you please update to the app to newest version and try again?

leemgs

leemgs

2023-10-25 15:55

reporter   ~77981

To tibor.pacalat,

To reproduce my report consistently, I temporarily opened the website listed below.

  1. Test webpage to evaluate the file uploaded on Chrome browser

    • Chrome Browser Version: 118.0.5993.89 (64bit)
    • LimeSurvey Community Edition Version: 6.2.11+231007
    • Web Link: http://leemgs.mooo.com:8888/index.php/791291?lang=en
    • Actual result while uploading a file (e.g., .png) on Chrome browser
      { "success":true,"size":4.4736328125,"name":"images.png","ext":"png","filename":"futmp_rifdxuifu6cswam_png","msg":"The file has been successfully uploaded." }
  2. How to reproduce this issue with LimeSurvey 6.2.11+231007
    $ git clone https://github.com/martialblog/docker-limesurvey.git
    $ cd docker-limesurvey
    $ git checkout 6.2.11-231007
    (2c34e0fd7313d2f5a38e844c40bf2e3b03019585 (tag: 6.2.11-231007))
    $ vi docker-compose.yml

      • "8080:8080"
      • "8888:8080"

        $ docker-compose --version
        Docker Compose version v2.23.0
        $ docker-compose up

Frontend

$ firefox http://localhost:8888/

Backend

$ firefox http://localhost:8888/index.php/admin

leemgs

leemgs

2023-10-25 16:10

reporter   ~77986

I also evaluated LimeSurvey with version 6.3.0+231016. But the file upload is still not okay. :(

tibor.pacalat

tibor.pacalat

2023-10-25 16:23

administrator   ~77993

I used your temporary server and I can upload the image without an issue.

holch

holch

2023-10-25 17:55

reporter   ~78003

I have also tested the temporary server with both, Chrome and Edge (see forum post) and the upload works as expected. On submitting I am getting an error message (in both browsers): "Error moving file to target destination". But the upload works, just like Tibor shows in his video.
https://forums.limesurvey.org/forum/can-i-do-this-with-limesurvey/142732-how-to-upload-image-file-on-chrome-brwoser#251521

Try with a "clean" Chrome browser (no addons/plugins) or with Chrome on a different computer.

leemgs

leemgs

2023-10-26 01:02

reporter   ~78023

Dear holch,

Try with a "clean" Chrome browser (no addons/plugins) or with Chrome on a different computer.

I evaluated the file upload feature with Crhome version 118 after cleaning the addons/plugins as follows.
It's okay without any issues. BTW, Is there any way I can run the file upload feature in LimeSurvery
without resetting the plugins in my Chrome browser?

  • [Recipe] How to initialize plugins to resolve the file upload error in the Chrome browser:
    (1) In Chrome, click the user icon in the top right corner, then click the "+Add" menu.
    (2) Click the "Continue without an account" button, type "guest", and click "Done".

BRs,
Geunsik Lim.

leemgs

leemgs

2023-10-26 04:48

reporter   ~78026

I attached two screenshot files.

  1. Success screenshot: test result after initializing with the Continue without an account" button button.
  2. Failure screenshot: test result with existing Google Chrome add-on setting.
tibor.pacalat

tibor.pacalat

2023-10-26 11:59

administrator   ~78037

Since this is not a bug, I will close this ticket. Please ask this question on official forum.

Issue History

Date Modified Username Field Change
2023-10-25 09:28 leemgs New Issue
2023-10-25 09:28 leemgs Issue generated from: 19192
2023-10-25 10:22 DenisChenu Relationship added duplicate of 19192
2023-10-25 12:07 tibor.pacalat Note Added: 77969
2023-10-25 12:07 tibor.pacalat Bug heat 0 => 2
2023-10-25 12:08 tibor.pacalat Assigned To => tibor.pacalat
2023-10-25 12:08 tibor.pacalat Status new => feedback
2023-10-25 15:55 leemgs Note Added: 77981
2023-10-25 15:55 leemgs File Added: limesurvey-fileupload-err.JPG
2023-10-25 15:55 leemgs Bug heat 2 => 4
2023-10-25 15:55 leemgs Status feedback => assigned
2023-10-25 16:10 leemgs Note Added: 77986
2023-10-25 16:10 leemgs File Added: limesurvey630-fileupload-err.JPG
2023-10-25 16:23 tibor.pacalat Note Added: 77993
2023-10-25 16:23 tibor.pacalat File Added: Screen-2023-10-25-162129.mp4
2023-10-25 17:55 holch Note Added: 78003
2023-10-25 17:55 holch Bug heat 4 => 6
2023-10-26 01:02 leemgs Note Added: 78023
2023-10-26 01:02 leemgs File Deleted: limesurvey630-fileupload-err.JPG
2023-10-26 01:02 leemgs File Deleted: limesurvey-fileupload-err.JPG
2023-10-26 04:48 leemgs Note Added: 78026
2023-10-26 04:48 leemgs File Added: Screenshot_20231026_071948_bVNC Pro.jpg
2023-10-26 04:48 leemgs File Added: Screenshot_20231026_072003_bVNC Pro.jpg
2023-10-26 04:48 leemgs File Added: Screenshot_20231026_072111_bVNC Pro.jpg
2023-10-26 11:59 tibor.pacalat Note Added: 78037
2023-10-26 11:59 tibor.pacalat Status assigned => closed
2023-10-26 11:59 tibor.pacalat Resolution open => duplicate