Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    How do you visualize the images?

    Hi, I got the same problem. I have picture contest form that allows user to upload images, then I will pick a winner. But whenever I click the link of the uploaded files in CFDB, it says “cannot be displayed because it contains errors.”

    Note:
    I removed the auto cleanup function of CF for the uploaded images.

    Can you help me with this.

    Plugin Author Michael Simpson

    (@msimpson)

    “I removed the auto cleanup function of CF for the uploaded images”

    What does this mean? There is no such function in CFDB.

    I mean the function on CF7 that deletes the uploaded file once it’s sent to email.

    Thread Starter Rafael Nathan

    (@rafaelnco)

    @michael Simpson: To visualize the images I click the uploaded image’s link in any Returned Entries in CFDB Main Dashboard (WordPress Menu > Contact Form DB > Contact Form DB).

    Clicking the image’s link on the uploaded image field open’s a new tab which loads the following URL:

    http://myhost.com/wp-admin/admin-ajax.php?action=cfdb-file&s=1443558903.3771&form=FORM+1&field=UPLOADEDIMAGEFIELD

    When the page is loaded, all I see is an icon of a broken image (http://www.underconsideration.com/brandnew/archives/google_broken_image_02_grid_base.png)

    Here’s what I’ve got whenever click the file upload link in cdfb

    http://www.screencast.com/t/Sx2IniKVZK

    Plugin Author Michael Simpson

    (@msimpson)

    You can google the error message: “Cannot be displayed because it contains errors”

    Possible issues are:

    • File extension doesn’t match the actual file type, confusing the browser
    • An error message was generated…open the file in a text editor to see if there is anything at the beginning
    • Other?
    Thread Starter Rafael Nathan

    (@rafaelnco)

    @michael Simpson

    I’ve Googled everywhere and the most promising clue I’ve found is in this link in which you mention something about LONGBLOBS and MySQL version.

    Although this is a 4 year old thread, what are the chances the bug persists? I just checked and verified my server configuration:

    Server version: 5.5.38-35.2
    Database client version: libmysql – 5.1.73

    This is a shared host and it seems like I’m not able to update anything. Is there a way to solve this? Thanks in advance.

    Plugin Author Michael Simpson

    (@msimpson)

    @rafaelnco I don’t know if the client lib version mismatch is causing the problem. Even if it does, if you can’t upgrade anything then I don’t see what you can do to fix it.

    As an alternative, you could have CFDB save the file to disk somewhere under the WordPress directory structure so that it can be accessed via URL.

    Thread Starter Rafael Nathan

    (@rafaelnco)

    @michael Simpson,

    You’re right, all I can do is to modify the source code. Although your suggestion is already my top alternative, what are the chances I can get this problem fixed by modifying the SQL Query which returns the image?

    I’ve already checked the BLOB and it is not corrupted in any way (I downloaded it directly from database and it opens flawlessly in my linux), so my guess is there is some way to tweak the WordPress Action that queries the BLOB in the database. Do you think this tweak is possible?

    Plugin Author Michael Simpson

    (@msimpson)

    My suggestion does not involve modifying the plugin source code. You add code that hooks into the plugin to extend it. (It won’t be overwritten by a plugin update.)

    Is the file quite large? The PHP will read in the whole file before sending it back to you. If the file is too big for the memory allocated for PHP, it may fail. You could test this hypothesis with a small file (a few MB or less).

    The query is pretty straight forward using $wpdb. I don’t see a way to tweak it.

    I tried this fix. Edit CF7DBPlugin.php and made sure to call ob_clean() before calling the header information in the ajaxFile function. And it fix the issue. Same as here

    Plugin Author Michael Simpson

    (@msimpson)

    OK. I’ll push version 2.9.10 with the fix.

    Thread Starter Rafael Nathan

    (@rafaelnco)

    @jpoleng @michael Simpson

    There are no words to describe how I’m feeling right now. Thank you so much for your support, I’m sure this thread will lead to many people being proud of WordPress Community Support as I am.

    My issue is fixed and my team can get back to work with this beautiful tool. You’re the best!

    Plugin Author Michael Simpson

    (@msimpson)

    Thank you for figuring out the solution!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘CFDB won't display uploaded image correctly (although, BLOBs fine)’ is closed to new replies.