Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Thumbnails do not appear when using FileUpload

dnigrindnigrin
edited December 2014 in Vanilla 2.0 - 2.8

This is a continuation of a discussion started on this thread. In short, using FileUpload plugin version 1.8.4.1, and Vanilla version 2.1.6 on an IIS server, after choosing an image file to upload and uploading it, the thumbnail does not show the image, and the resulting final post also doesn't show the thumbnail image. If you click the image of the broken thumbnail link though, the full image appears in a new window.

@peregrine, no the thumbnail image that is supposed to appear after uploading the file, as well as the full image that appears with the eventual post, never appear.

I did as you suggested to look at the page using a developer options for Safari, and sure enough I see:

Failed to load resource: the server responded with a status of 404 (Not Found)
http://MyWebSite.com/forum/uploads/E:/HostingSpaces/dnigrin/MyWebSite.com/wwwroot/forum/uploads/thumbnails/FileUpload/79/3fde56e4e12c30dc45a60d94ae8b4b.jpg

So that clearly isn't the correct URL for the image - it should be just:
http://MyWebSite.com/forum/uploads/thumbnails/FileUpload/79/3fde56e4e12c30dc45a60d94ae8b4b.jpg

Ideas for what I need to do to correct this? Is this a problem in the plugin code, or some configuration with my IIS server? FWIW, with previous versions of this plugin and Vanilla 2.0.18.x, it worked fine on the same IIS server..

Thanks again in advance.

Tagged:

Comments

  • Options
    peregrineperegrine MVP
    edited December 2014

    try deleting the file upload plugin folder.

    and give this one a try.

    http://vanillaforums.org/discussion/26644/a-fix-to-make-fileupload-version-1-8-2-to-work-in-vanilla-2-1-backport

    if that doesn't work let me know.

    also take a look at this for the future.

    http://vanillaforums.org/discussion/comment/220031/#Comment_220031

    you still need to answer the question. did the thumbnail get created in the folder.

    also post your .htaccess file.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    dnigrindnigrin
    edited December 2014

    Thank you peregrine.

    Reverting to the 1.8.2.1 version of FileUpload in that thread (I used the "replacements 2" zip) did not change the behavior at all compared to 1.8.4.1.

    Yes, the thumbnail was created correctly here:
    http://MyWebSite.com/forum/uploads/thumbnails/FileUpload/79/3fde56e4e12c30dc45a60d94ae8b4b.jpg

    And the full image was successfully uploaded to:
    http://MyWebSite.com/forum/uploads/FileUpload/79/3fde56e4e12c30dc45a60d94ae8b4b.jpg

    My .htaccess file contents are as below:

    # Original
    # If you modify this file then change the above line to: # Modified
    <IfModule mod_rewrite.c>
       RewriteEngine On
       # Certain hosts may require the following line.
       # If vanilla is in a subfolder then you need to specify it after the /. 
       # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
       # RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
    </IfModule>
    

    And finally, thanks for the tip on correctly posting a question re: a specific plugin, will use that method in the future.

  • Options

    Also, I should point out that I just tried modifying the .htaccess file to uncomment the RewriteBase line, and to make it read

    RewriteBase /forum

    It did not make any difference with the thumbnail behavior, I tried stopping and restarting the plugin as well, and creating a new test post. Same thing, no thumbnail visible.

  • Options

    @dnigrin I sent you a pm.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    For other's benefit (actually for MY benefit, when I forget what I did with this a year or two down the line..) - it seems that my IIS server is not set up for URL rewrites (or something like that, peregrine you can correct me if necessary), so he helped me with a hard-coded workaround in the plugin to address this.

  • Options
    peregrineperegrine MVP
    edited December 2014

    dnigrin siad

    For other's benefit (actually for MY benefit, when I forget what I did with this a year or two down the line..) - it seems that my IIS server is not set up for URL rewrites (or something like that, peregrine you can correct me if necessary), so he helped me with a hard-coded workaround in the plugin to address this.

    dnigrin, thank you for the donation for troubleshooting and workaround.

    I don't know exactly what created the problem. I don't know IIS.

    the op said enabling rewrite of urls in config.php seemed to cause problems elsewhere. so that could be the ultimate issue. and i dont know IIS.

    besides V's info this may be of interest as well.
    http://www.iis.net/downloads/microsoft/url-rewrite

    the issue was that the thumbnail column in media table was getting the E:// .......

    just added a line after this line

    https://github.com/vanilla/addons/blob/master/plugins/FileUpload/class.fileupload.plugin.php#L616

    to parse out and preg replace the extra the E:// ....... in the $ThumbParsed['SaveName']

    so something in the return of $ThumbParsed['SaveName'] from https://github.com/vanilla/addons/blob/master/plugins/FileUpload/class.fileupload.plugin.php#L609 is causing issue, which i didn't research because I can't replicate an IIS server.

    I don't know if this is IIS specific, rewrite rules being bad or whatever. since I don't have access to the server itself.

    so the issue with dnigrin is solved , but the mystery of the cause is still elusive.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    IIS apparently uses a file called webconfig in place of an htaccess file.

    One just needs to write it properly to replace the htaccess completely.

    About the thumb, yes I don't think the two are related since it happens to other people who do use apache.

  • Options
    peregrineperegrine MVP
    edited December 2014

    just as you must have mod rewrite enable a2enmod in apache, there is an IIS configuration for something similar.

    there is more to it. thats why I posted links!

    also a good write up on rewriting url stuff and config. although wp examples, may give some insights.
    http://codex.wordpress.org/Using_Permalinks

    as far as other conjecture, I leave that to you V.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.