[BNM] php: hide file (an msi) URL

Alan Braddish alan at webspoke.co.uk
Tue Nov 14 11:45:10 GMT 2006


Sorry to butt in here, but I did something similar recently using ASP and
I'm sure the same principle applies to PHP, just with different syntax.

Essentially, you create a download script and use a function such as
readfile() to get the .msi file contents into a variable.

You then set the header to send the user a chosen filename [1] (can be
anything you like - doesn't have to be the name of the real file)

You then use another function to stream the .msi file from the variable back
to the user, making sure you set the appropriate MIME Content Type.

When the user clicks on the download script, they will be presented with an
Open/Save dialog of the file name you specified at [1] - they then know
nothing about the original location of the file.

That's the essence of it.  Hope that helps.

Alan


-----Original Message-----
From: Jason Bailey [mailto:jason at sussex.ac.uk] On Behalf Of Jason Bailey
Sent: 14 November 2006 11:29
To: brighton new media
Subject: [BNM] php: hide file (an msi) URL


> t sounds like you need the readfile and header functions.
>
> http://uk.php.net/manual/en/function.readfile.php
> http://uk.php.net/manual/en/function.header.php

Hi Matt,

Can you give me an example of what you mean. No need for code but just a 
few words as I've not really got it yet.

I see I could post to a page and use the header function to take the 
browser to another page but I don't see how that would hide the location of 
the URL. Or do i use the header to post to the MSI. Actually I think I've 
got the idea. Should i be creating a new temp file e.g. 
xyzrandomstring123.msi amd using the header to forward the user to this MSI 
or a page linking to this MSI.

Jas



-- 
Jason Bailey
IT Services
University of Sussex
http://www.sussex.ac.uk/USIS/phone/details.php?id=17011

-- 

BNM info/subscription/archives: http://www.brightonnewmedia.org/

BNM archive search: http://www.roddis.org/bnm/search.php
BNM Del.icio.us tag: http://del.icio.us/tag/bnm/
BNM Flickr group: http://www.flickr.com/groups/bnm/

BNM powered by http://www.screen-play.net/




More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service