1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How would you if same one views a pic to start downloading a file?

Discussion in 'Black Hat SEO' started by pussyback, May 28, 2008.

  1. pussyback

    pussyback Regular Member

    Joined:
    Apr 5, 2008
    Messages:
    402
    Likes Received:
    79
    let say I have a jpg image on my server http://www.myserver.com/1.jpg when someone request it i want it auto start downloading a file like http://www.myserver.com/1.zip .
     
  2. n8800

    n8800 Regular Member

    Joined:
    May 21, 2008
    Messages:
    465
    Likes Received:
    210
    I know how to make it if someone clicks on the pic not when they view it.
     
  3. agj32mrgibbits

    agj32mrgibbits Registered Member

    Joined:
    Mar 1, 2008
    Messages:
    73
    Likes Received:
    50
    you will need to rewrite 1.jpg to download.php using htaccess and in download.php have this code:
    PHP:
    $fileurl='';//URL TO YOUR FILE
    $size=strlen(file_get_contents($fileurl));
        
    header('Content-type: application/force-download');
        
    header('Content-Disposition: inline; filename="'.$fileurl.'"');
        
    header('Content-Transfer-Encoding: Binary');
        
    header('Content-length: '.$size);
        
    header('Content-Disposition: attachment; filename="'.basename($fileurl).'"');
        
    readfile($fileurl);
     
  4. pussyback

    pussyback Regular Member

    Joined:
    Apr 5, 2008
    Messages:
    402
    Likes Received:
    79
    I know how to do that. , what I want is let stay I post a my pic on my my*space and some one go there it will automatally start download my file
    I need to know what to put in the .htaccess that when a webbrowser reqeust my pic it automatlly start downloading the file.
     
  5. pussyback

    pussyback Regular Member

    Joined:
    Apr 5, 2008
    Messages:
    402
    Likes Received:
    79
    thank you!! I will try it
     
  6. pussyback

    pussyback Regular Member

    Joined:
    Apr 5, 2008
    Messages:
    402
    Likes Received:
    79
    how do you rewrite 1.jpg to download.php using htaccess ?
     
  7. agj32mrgibbits

    agj32mrgibbits Registered Member

    Joined:
    Mar 1, 2008
    Messages:
    73
    Likes Received:
    50
    in htaccess:

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    
    RewriteRule ^1.jpg$ $download.php
    
     
    • Thanks Thanks x 1
  8. jmhmedia

    jmhmedia Junior Member

    Joined:
    May 20, 2007
    Messages:
    133
    Likes Received:
    32
    Location:
    C Town, CA
    Would that work for those silent install PPI's? Or would it just download it ?
     
  9. agj32mrgibbits

    agj32mrgibbits Registered Member

    Joined:
    Mar 1, 2008
    Messages:
    73
    Likes Received:
    50
    no, its just a normal download
     
  10. interpro

    interpro Registered Member Premium Member

    Joined:
    Feb 27, 2008
    Messages:
    92
    Likes Received:
    210
    Home Page:
    You could do this with a simple javascript. Place the image of interest in a simple webpage. In the body tag of the page you'd just put onLoad="location.href=file2download.zip"

    This way, as soon as the page loads, the download will start. No need to fool around with htaccess or php.
     
  11. agj32mrgibbits

    agj32mrgibbits Registered Member

    Joined:
    Mar 1, 2008
    Messages:
    73
    Likes Received:
    50
    not everyone has javascript enabled though
     
  12. dddd

    dddd Jr. VIP Jr. VIP Premium Member

    Joined:
    Jun 4, 2007
    Messages:
    164
    Likes Received:
    158
    why not simply put the url of the zip as url of the picture, it will download the file also - maybe I don't see the point, but if you could tell, what you are trying to achieve, I might help - feel free to PM me if it is confidential
     
  13. pussyback

    pussyback Regular Member

    Joined:
    Apr 5, 2008
    Messages:
    402
    Likes Received:
    79
    I was trying to post my pic in my sig on ez*boa*rd forum and when people view the tread it would auto start downloading my ppi
     
  14. dddd

    dddd Jr. VIP Jr. VIP Premium Member

    Joined:
    Jun 4, 2007
    Messages:
    164
    Likes Received:
    158
    I see, well that's not working unfortunately, but good idea though - the problem is, it will download the ppi, BUT it will not install it - it will just download to their temporary files folder and sit there - so makes no sense, sorry. (however, you might stuff a cookie from your sig - anyway in both cases it will not display the picture at all)
     
    • Thanks Thanks x 1
  15. pussyback

    pussyback Regular Member

    Joined:
    Apr 5, 2008
    Messages:
    402
    Likes Received:
    79
    thank you , My idea was to get a domain close to like "adobeflashplayer" and name the file flashupdate.... so noob would think it a flash update and install it