Results 1 to 4 of 4

Thread: PHP/ASP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User rumen_33's Avatar
    Join Date: May:2007
    Location: Canada
    Posts: 137

    PHP/ASP

    ,

    , , "Save target as", File Download . Content-Disposition header, . ,

    Code:
    <% 
        Response.ContentType = "application/x-unknown" ' arbitrary 
        fn = "whatever.jpg" 
        FPath = "c:\" & fn 
        Response.AddHeader "Content-Disposition","attachment; filename=" & fn 
     
        Set adoStream = CreateObject("ADODB.Stream") 
        adoStream.Open() 
        adoStream.Type = 1 
        adoStream.LoadFromFile(FPath) 
        Response.BinaryWrite adoStream.Read() 
        adoStream.Close 
        Set adoStream = Nothing 
     
        Response.End 
    %>
    
       download.asp


    Code:
    <html>
    
    <head>
    <meta http-equiv='refresh' content='0;url=download.asp'>
    <title>Nothing</title>
    </head>
    
    <body>
    <a href = "image.jpg">Download</a>
    </body>
    
    </html>
    
      : index.html
    .

    !

    !
    |Asus P5K Premium WiFi|Intel C2D E6750|Kingston 2x1GB@667MHz|Seagate 250GB+500GB|Coolmax CP 500W|Asus EN 8800 GTS 320MB|

  2. #2
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    PHP :

    header("Content-Type: application/octet-stream");
    header("Content-Disposition: attachment; filename=z0ne.html");

  3. #3
    Registered User rumen_33's Avatar
    Join Date: May:2007
    Location: Canada
    Posts: 137
    , .php . , , , z0ne.html .

    !
    |Asus P5K Premium WiFi|Intel C2D E6750|Kingston 2x1GB@667MHz|Seagate 250GB+500GB|Coolmax CP 500W|Asus EN 8800 GTS 320MB|

  4. #4
    White awesomeness z0ne's Avatar
    Join Date: Feb:2002
    Location: o
    Posts: 13,331
    Quote Originally Posted by rumen_33 View Post
    , .php . , , , z0ne.html .

    !
    - : download.php. "header-a" "z0ne.html" ( ), . - download.php?id=1 Id = 1 , / .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |