webid 1.3.0 wont display images in auction gallery

Discussion in 'General Support' started by kanra, Jun 8, 2016.

  1. kanra

    kanra Member

    Joined:
    Jun 2, 2016
    Messages:
    32
    Likes Received:
    3
    Hello, a fresh install of webid 1.3.0 will accept and upload images to any given auction, but after the auction is created the images wont display, intead a 404 not found error will pop, i noticed that the url to the images contain this format /path/to/image/name_of_image.jpg but in the actual folder where the images are stored all of the images are named name_of_image.jpg.part, i know this is why i get the 404 error page.

    also i tried change owner and permission recursively on the images folder wich resulted in breaking the whole image upload system, rendering image upload impossible.

    i know the best practice would be to reinstall webid and then find the script wich copies the temp file to the image folder with name_of_image.jpg.part and get rid of the bit of code that does the .part thing, any gidance as to wich script does this would be really appreciated

    greetings.
     
  2. kanra

    kanra Member

    Joined:
    Jun 2, 2016
    Messages:
    32
    Likes Received:
    3
    i forgot to mention i've already set uploaded folder permission to 777, yet the problem lies on the name of the file.
     
  3. hhavatar

    hhavatar Donor Donor

    Joined:
    Jul 28, 2014
    Messages:
    747
    Likes Received:
    74
    whats showing in the error log?
     
  4. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    .part is usualy a file associated with when you download something in Google Chrome or Firefox Browser, while Chrome or Firefox is downloading the file it assigns a .part extension to the end of the file name, I know this because I download a lot from the web in Chrome and I have seen it in action for myself.

    If you're using Google Chrome try clearing the Chrome history and while doing so in the box select everything except for Passwords and Autofill Form Data and make sure to select THE BEGINNING OF TIME from the drop down box then click Clear Browsing Data button.

    If you're Using Firefox you will have to look into how to remove all the browsing history/cache yourself as it has been a long time since I used it.

    Shut Chrome or Firefox down and restart it then try uploading again to your auction to see if the same thing happens and if it does then you may have a corrupted Chrome or Firefox Browser and Chrome or Firefox are applying a .part extension to Uploads as well as, or instead of, just Downloads.

    For more information on what a part file is see this LINK
     
    Last edited: Jun 10, 2016
  5. kanra

    kanra Member

    Joined:
    Jun 2, 2016
    Messages:
    32
    Likes Received:
    3
    error log is clear.
     
  6. kanra

    kanra Member

    Joined:
    Jun 2, 2016
    Messages:
    32
    Likes Received:
    3
    i also know about this behavior in firefox, it may not be related since this is an upload, i fixed it by adding the '.part' string in the script that moves temp files to the auction id directory located at uploads dir, in sell.php
     
  7. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    Yeah I know it is an upload hence me saying this

    Can't be any clearer than that really it seems weird how no one else has ever had the same problem your having.

    Glad you got it sorted though.
     
  8. kanra

    kanra Member

    Joined:
    Jun 2, 2016
    Messages:
    32
    Likes Received:
    3
    yeah it might be related to the os im using, greetings
     
  9. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    OK I never realised you were using the latest version of WeBid 1.2 I missed that in your first post in this topic as you said 1.3.0 and not 1.2 as the latest version is 1.2.0 or 1.2 I took it you was using the old 0.8.3.

    I can confirm that this is infact a problem.

    Temporary folders are being made by the uploader with the long numbered folder number and any image uploaded to it is being saved with a .part extension however when clicking the submit button the folder is then renamed to the auction ID as it should be, but the uploaded image is being lost somewhere.

    I will have a look at upload.php see if I can spot anything.

    It is not your browser so scrap that idea.
     
    Last edited: Jun 11, 2016
  10. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    could you share the lines of code please so I can submit them to github for the next release
     
  11. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    I think someone has seriously messed upldgallery.php up big time probably by trying to add a digital items upload to it or something else silly.

    Anyway half the code that was in upldgallery.php in WeBid 1.1.2P2 is missing from WeBid 1.2 see bellow.

    All this code that processes the uploaded image is missing from 1.2
    PHP:
    // PROCESS UPLOADED FILE
    if (isset($_POST['uploadpicture']) && $_POST['uploadpicture'] == $MSG['681'])
    {
        if (!empty(
    $_FILES['userfile']['tmp_name']) && $_FILES['userfile']['tmp_name'] != 'none')
        {
            if (!isset(
    $_SESSION['UPLOADED_PICTURES']) || !is_array($_SESSION['UPLOADED_PICTURES'])) $_SESSION['UPLOADED_PICTURES'] = array();
            if (!isset(
    $_SESSION['UPLOADED_PICTURES_SIZE']) || !is_array($_SESSION['UPLOADED_PICTURES_SIZE'])) $_SESSION['UPLOADED_PICTURES_SIZE'] = array();
            
    $filename $_FILES['userfile']['name'];
            
    $nameparts explode('.'$filename);
            
    $ext_key count($nameparts) - 1;
            
    $file_ext strtolower($nameparts[$ext_key]);
            
    $file_types = array('gif''jpg''jpeg''png');

            
    // clean the name
            
    unset($nameparts[$ext_key]);
            
    $newname implode('_'$nameparts);

            
    $newname preg_replace('/[^a-zA-Z0-9_]/'''$newname);
            
    $newname .= '.' $file_ext;

            if (
    $_FILES['userfile']['size'] > $system->SETTINGS['maxuploadsize'])
            {
                
    $ERR $ERR_709 ' ' . ($system->SETTINGS['maxuploadsize'] / 1024) . ' ' $MSG['672'];
            }
            elseif (!
    in_array($file_ext$file_types))
            {
                
    $ERR $ERR_710 ' (' $file_ext ')';
            }
            elseif (
    in_array($newname$_SESSION['UPLOADED_PICTURES']))
            {
                
    $ERR $MSG['2__0054'] . ' (' $_FILES['userfile']['name'] . ')';
            }
            else
            {
                
    // Create a TMP directory for this session (if not already created)
                
    if (!file_exists($upload_path session_id()))
                {
                    
    umask(0);
                    
    mkdir($upload_path session_id(), 0777);
                    
    chmod($upload_path session_id(), 0777); //incase mkdir fails
                
    }
                
    // Move uploaded file into TMP directory & rename
                
    if ($system->move_file($_FILES['userfile']['tmp_name'], $upload_path session_id() . '/' $newname))
                {
                    
    // Populate arrays
                    
    array_push($_SESSION['UPLOADED_PICTURES'], $newname);
                    
    $fname $upload_path session_id() . '/' $newname;
                    
    array_push($_SESSION['UPLOADED_PICTURES_SIZE'], filesize($fname));
                    if (
    count($_SESSION['UPLOADED_PICTURES']) == 1)
                    {
                        
    $cropdefault true;
                        
    $image $newname;
                    }
                }
            }
        }
    }
    However adding that back still does not fix things.

    For some reason all images being uploaded to the temporary folder that is created according to the sell session like 4p9rsmbt0sl6qsv3a2u5d2bd43 all images in that temporary folder are being given an extension of .JPG.part (Notice the uppercase JPG and the .part added on the end) not just .JPG or .jpg but .JPG.part we need to find out where this .part is being added on the end of everything because I am almost certain that the extension being added of .JPG.part is what is stopping the image finally being added to a folder named the same as the auction ID when submitting upldgallery.php.

    How it works at the moment when I upload an image it gets given the .JPG.part extension and the thumbnail is not shown in upldgallery.php but if I then right click where the thumbnails should be and select inspect element we are given the wrong URL to the image the URL given does not have a .JPG.part on the end but instead has a .jpg, now if at this point we right click again and select edit as html and change the image source right at the end from .jpg to .JPG.part the image shows up in upldgallery.php.

    We need to find out where it is adding .JPG.part and stop it doing it.

    Someone has seriously messed up on the upldgallery.php here.

    I have looked at upldgallery.php and all files that are linked or included with the upldgallery.php and can not for the life of me see where it is adding an uppercase .JPG followed by a .part.

    I even totally removed all .htaccess files from WeBid incase it was those making the problem but still no change.

    :confused: This WeBid 1.2 just gets better and better everyday with another bug on top of another bug, I am starting to feel like we are back at WeBid 0.8.6 :) I just wish I could look at PHP and PDO and understand the stuff like some people can.

    I am submitting this thread to the Bug Tracker as URGENT.
     
    Last edited: Jun 11, 2016
  12. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    I've been complaining about the pluploader from the start. I added a fix to it here a couple of weeks ago. http://www.webidsupport.com/forums/...ploader-not-uploading-images.9748/#post-50098 I even tagged renlok's name in it to check it out. It seemed like nobody realized there was a problem there.

    Hey that was the thread that sparked me up a little too after I was told to post in only thread area. It's all in the past now. Everything is A okay now!
     
    nay27uk likes this.
  13. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    Thanks David so does that thread take care of it adding a .part? I will go and have a look at it mate and if it fixes things I will submit it to github as it is not on github because I updated all my WeBid files with the github ones incase the problem had been fixed
     
  14. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    I wanted somebody to test it because I don't know with the new coding if it was all good. I think it's right. It will work for now.
     
  15. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,565
    Likes Received:
    544
    nope replaced the files with you zip ones and still the same mate however the images do get moved now into the auction ID folder so they are there but still no thumbs showing on the site at all or in the uploader when uploading them.
     
  16. kanra

    kanra Member

    Joined:
    Jun 2, 2016
    Messages:
    32
    Likes Received:
    3
    just posted the line of code and which line to replace it with on the bug tracker, also attached sell.php with the changes already made so you can test fast. greetings
     
  17. reactiveflow

    reactiveflow New Member

    Joined:
    Nov 14, 2012
    Messages:
    12
    Likes Received:
    0
    Images are not showing during/after uploading, I just get a small question mark box, and image not found picture attached to auction.
    I changed the maximum size from 50kb to 500kb, and am working within that. I also get the same error when uploading a 20kb image.
    Code:
    Unknown error type: [2] unlink(/tmp/phprXDKCe): No such file or directory on /homepages/36/d571565438/htdocs/Reactiveflow_Auction/includes/functions_global.php line 269
    Unknown error type: [2] unlink(/tmp/phpeYJXbn): No such file or directory on /homepages/36/d571565438/htdocs/Reactiveflow_Auction/includes/functions_global.php line 269
    Unknown error type: [2] unlink(/tmp/phphqpnl0): No such file or directory on /homepages/36/d571565438/htdocs/Reactiveflow_Auction/includes/functions_global.php line 269
    Unknown error type: [2] unlink(/tmp/phpo6UmGf): No such file or directory on /homepages/36/d571565438/htdocs/Reactiveflow_Auction/includes/functions_global.php line 269
    Unknown error type: [2] unlink(/tmp/phpq1ZJ60): No such file or directory on /homepages/36/d571565438/htdocs/Reactiveflow_Auction/includes/functions_global.php line 269
    
    I did add honeypot items to header.tpl and global header.tpl after install as per forum instructions. I reverted to original theme to see if this was causing the problem, but it's still not working.
     
    Last edited by a moderator: Jun 26, 2016
  18. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    This error here is from a tmp file. Try to clear your cache and clear the image cache and see if that helps.

    I just fixed this issue and I have a much better understanding of how the PluploadHandler.php code is set up. First the filename is supposed to be named with the .part at the end of the filename and then quickly renamed to be a filename without the .part at the end of the filename. The rename on the page was causing issues because the files in the uploaded folder were being named with the .part at the end. Check this post out. 1.2 Version: Pluploader not uploading images I mention how to set up your PHP system to work with the pinfo code and on what parts of the codes to update. That php set up will only work on PHP 5.3 and up. There is also a zip file I shared there in that post so, feel free to use it. That will get the uploads to work properly with no errors.
     
  19. reactiveflow

    reactiveflow New Member

    Joined:
    Nov 14, 2012
    Messages:
    12
    Likes Received:
    0
    I've cleared the cache and put PHP 5.6 on
    I'm now getting different errors eg;

    Unknown error type: [2] getimagesize(failed to open stream: No such file or directory
    /PluploadHandler.php line 364
    Unknown error type: [2] filesize(): stat failed for
    /PluploadHandler.php line 169
    Unknown error type: [2] rename uploaded

    I'm also getting jpg.part and gif.part etc, in created image folders as described.
    I'll have a go with your zip file from the other post - is this the best way forward?
     
  20. david62311

    david62311 Well-Known Member

    Joined:
    Aug 29, 2013
    Messages:
    2,118
    Likes Received:
    236
    Click the link I shared in post #19 and you can use the file I shared or follow the directions I posted. It's a rename error issue you got there. They were the same errors I was seeing when I worked on fixing it. From looking at your errors it looks like it's just the rename issue for you. The line 364 error will fix itself once it finds the proper name. Your PHP selections are most likely already selected so, you probably won't have to touch that part that I mentioned in the other link. Try that and if you need any more help let us know.
     

Share This Page