Announcement

Collapse
No announcement yet.

Uploaded images are broken

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reestv
    replied
    Thank you for the response.
    Having attempted to upload a file via this script, I can confirm that the issue more than likely lies with PHP's configuration itself, and not with vBulletin.
    I shall look into this further from appropriate websites.

    Thank you very much for all the assistance.
    Best Regards.

    Leave a comment:


  • Joe D.
    replied
    Attached is a very simple file upload script I found on Stack Oveflow.

    Create a new empty directory on your server.
    Unzip the file and upload the simple_upload.php file to your server.
    Browse to it in your browser.
    The first screen you must enter the password: pass123
    The next screen you can choose a file and upload it.
    Make sure you are in an empty directry because uploading will overwrite an existing file of the same name.
    After upload, check if file exists/works.

    This is the most simple PHP upload you will find and can determine if the problem lies on the server level for sure.

    DELETE THE SCRIPT when you are done testing- you do not want such a script live on your site.
    Attached Files

    Leave a comment:


  • Reestv
    replied
    Thank you for the response.

    Originally posted by Lynne View Post
    Try settings AdminCP > Settings > Options > Image Options > Image Library to none and then upload a jpeg image and see if you have problems.
    This did not work, weirdly, which makes me assume it might be a host issue?

    Originally posted by Lynne View Post
    Do you have suhosin or mod_security on the server?
    I put a code to disable suhosin in the init.php directory and restarted Apache. Nothing changed.
    Mod_security was not installed.

    Originally posted by Lynne View Post
    Is you cookie prefix exactly the same in both config.php files?
    Both cookie prefixes are 'bb'.

    Originally posted by Lynne View Post
    Did you make sure to use a plain text editor such as notepad++ when editing the config.php files (if not, you could have a BOM in there causing issues)?
    Originally posted by Zachery View Post
    I'm betting there is a bom in one of the files you have edited. Make sure that you save the config.php files as anything but UTF8 really. They're supposed to be ASCII encoded text files.
    I used Notepad++ for the config files, with the encoding default as: Encode in UTF-8 without BOM.
    Would you recommend using a new config.php file to be sure?

    Update: I tried using a non-related script about five minutes ago, in which I tried uploading a logo. The logo filepath was created but the logo was not uploaded. Do you think this would mean a server-side issue? If so, where would be the best place to troubleshoot (other than the server host)?

    Best Regards.

    Leave a comment:


  • Zachery
    replied
    I'm betting there is a bom in one of the files you have edited. Make sure that you save the config.php files as anything but UTF8 really. They're supposed to be ASCII encoded text files.

    Leave a comment:


  • Lynne
    replied
    Try settings AdminCP > Settings > Options > Image Options > Image Library to none and then upload a jpeg image and see if you have problems.

    Do you have suhosin or mod_security on the server?

    Is you cookie prefix exactly the same in both config.php files?

    Did you make sure to use a plain text editor such as notepad++ when editing the config.php files (if not, you could have a BOM in there causing issues)?

    Leave a comment:


  • Reestv
    replied
    Sorry to bump again, but I'm still having issues with this.

    Leave a comment:


  • Reestv
    replied
    There was no file path for the PHP error_logs, so I created one and restarted Apache (/var/log/php-scripts.log).
    I then published a post with a broken image, but no error file was created by PHP. I assume this means that there were no errors?

    Update: I'm not sure if this helps but,
    Click image for larger version

Name:	Capture.PNG
Views:	114
Size:	9.7 KB
ID:	4120960

    It seems to keep adding "Photos by Rees in image test" every time I open the broken image up again.
    This issue fixes itself if I refresh the page.
    Last edited by Reestv; Tue 12 Aug '14, 12:25pm.

    Leave a comment:


  • Lynne
    replied
    Do you get any errors in your error_logs (if you don't know where they are, ask your host) when you try to upload images?

    Leave a comment:


  • Reestv
    replied
    Originally posted by Mark.B View Post
    I notice the site in your license is an IP address, but your actual site, although accessible from the IP address, does use a domain name.

    Note that the two are not interchangeable...whatever you have set as the site URL in the AdminCP is the only one you should use to access the site.

    Not sure if this is your issue, but it's the first thing I spotted...don't use the IP address, anywhere.

    As an aside, you should update your license with the correct address to remain fully compliant.
    My apologies. I used the IP as a temporary address until the domain had propagated but forgot to update it once completed.
    This should now be updated.

    The site in the AdminCP uses the domain and I am trialing the image upload via the same domain. This still fails to work, strangely.
    Last edited by Reestv; Tue 12 Aug '14, 8:11am.

    Leave a comment:


  • Mark.B
    replied
    I notice the site in your license is an IP address, but your actual site, although accessible from the IP address, does use a domain name.

    Note that the two are not interchangeable...whatever you have set as the site URL in the AdminCP is the only one you should use to access the site.

    Not sure if this is your issue, but it's the first thing I spotted...don't use the IP address, anywhere.

    As an aside, you should update your license with the correct address to remain fully compliant.

    Leave a comment:


  • Reestv
    replied
    Thank you for the responses.

    I have created a 'tmp' folder in my /var/www directory and have chmod'd it to 1777.
    I then changed php.ini to this location and bumped up the max file size to 20MB as recommended.
    I then restarted Apache, but I'm still experiencing the same error when I try to upload images (broken image).

    This is now my diagnostics:



    If you have any suggestions I would greatly appreciate it.
    Best Regards.

    Leave a comment:


  • Joe D.
    replied
    Also, 2MB is a relatively small max PHP max upload size. If your images are small web graphics that is more than enough, but if your images are photos straight from a modern digital camera that won't be enough.

    Leave a comment:


  • Lynne
    replied
    If the php.ini setting for 'upload_tmp_dir' is empty (like you are showing) then It's possible you (as root) or your host will need to edit php.ini and set 'upload_tmp_dir' to point to the full path to a directory on the server that is chmod'd to 1777. You will also need to restart Apache after making this change.

    Leave a comment:


  • Reestv
    replied
    Thank you for the response. Here is what I get:



    I'm not sure whether the problem could be upload_tmp_dir or not, but - based on this - I think it could be?
    Where could I change this directory?

    Best Regards.

    Leave a comment:


  • Joe D.
    replied
    If you go to the Admin CP -> Maintenance -> Diagnostics and run the upload diagnostic, what result do you get?

    Leave a comment:

Related Topics

Collapse

Working...
X