On 5/5/05, Cima <[EMAIL PROTECTED]> wrote:
> i've uploaded some files into my postgresql db, via a php script, and now
> id like to give a user the posibility to download these files via a php
> script. what would be the best way to do this bearing in mind that the files
> are 'integrated' into th
I did exactly what you said but its not working for me. I am getting the
following error:
Warning: filesize(): SAFE MODE Restriction in effect. The script whose uid
is 20373 is not allowed to access /var/www owned by uid 0 in
/home/virtual/site341/fst/var/www/html/test.php on line 3
I checked
Aaron Todd wrote:
I have been using the following code to try to make it work:
The webroot of my site is at: /var/www/html
So far this will create a new file on my computer where ever I want, but it
does not download the contents of the file.
Any suggestions?
Thanks,
Aaron
It seems that PHP can
I have been using the following code to try to make it work:
The webroot of my site is at: /var/www/html
So far this will create a new file on my computer where ever I want, but it
does not download the contents of the file.
Any suggestions?
Thanks,
Aaron
"Octavian Rasnita" <[EMAIL PROTECT
You can put the files that need to be downloaded in a directory somewhere
outside of the web server root, but in that case your PHP program will need
to read the file and print it to the browser, and it will also need printing
the HTTP headers:
Content-type: application/octet-stream
Content-dispos
Aaron Todd wrote:
I posted a simular question before and never really got an answer. The post
drifted off into some other valuable information, but I still have the same
question.
I am trying to create a site with file downloads. The files on the server
that are to be downloaded need to be protec
Hi Aaron,
[..]
The download files are in a directory protected by htaccess which it
is my understanding that PHP can go underneath htaccess to get access
to the files. My problem is where do I put this directory? I was
already told to put it outside the web root directory,
[..]
Both are goo
The problem was solved. I added a call to the exit() construct at the end of
the function and haven't had any more problems since.
I would like to thank everyone who helped me.
Cheers,
Daniel
"Daniel Silva" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello.
>
> I tried what y
Hello.
I tried what you suggested and it's working alright. The problem is, that it
doesn't always work. I adapted your suggestion to what I needed. Instead of
creating a file, I made a fuction that does basically the same. All listed
files are links that enable the user to download them.
So far
There's actually a function in (PHP 4 >= 4.3.0) that returns a file's MIME
type.
Here it is:
string mime_content_type ( string filename)
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Yes, sure, but you many times won't know the mime type and might be
> forced to
Yes, sure, but you many times won't know the mime type and might be
forced to use application/octet-stream.
You can do
if(dirname(realpath($user_files_dir . $_GET['filename'])) ==
$user_files_dir)
as a security check
Daniel Silva wrote:
That is a very nice solution, the problem is, the files ar
That is a very nice solution, the problem is, the files are stored on disk,
not on the DB. I suppose it can be addapted to work with the disk, can't it?
Cheers,
Daniel
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> create a download php file:
>
>
> $res=mysql_q
create a download php file:
$res=mysql_query("select * from user_files where filename='$GET['file']'");
if($res && mysql_num_rows($res)) {
$file=mysql_fetch_assoc($res);
if($_GET['downaload']) {
header('Content-Type: application/octet-stream');
header('Content-disposition: a
At 00:52 24.02.2003, Anthony Rodriguez said:
[snip]
>In PHP, is there a way to allow the user to download a demo file (e.g.:
>sample.exe) to their computer? And, then, automatically return to the Web
>site?
[snip]
A
on 24/02/03 1:01 AM, Anthony Rodriguez ([EMAIL PROTECTED]) wrote:
> In PHP, is there a way to allow the user to download a file (e.g.:
> sample.txt) to their computer? And, then, automatically return to the
> PHP-generated Web page.
why do you need to re-run the page? it can be done with a bit o
> I want to protect files from being downloaded and only allow people to
> download files which they have access too. I've done all the access
> control
> etc... but whats the best way for the user to download the file... Can
you
> "paste" the file directly into the header? (get the file from the
got it!! :)
$filename = "backup.tar";
$download_file = "/absolute/path/backup.tar";
$fh = fopen("$download_file", "r");
header("Content-Type: application/x-tar");
header("Content-Disposition: attachment; filename=$filename");
fpassthru($fh);
exit();
Thanks a lot!! :)
"Justin French" <[EMAIL PRO
Either of these options will work fine. There was MASSIVE disscussions
about this a few weeks back -- check for threads started by myself in the
archives.
Justin French
on 26/06/02 12:35 AM, Francis ([EMAIL PROTECTED]) wrote:
> I want to protect files from being downloaded and only allow pe
On Wednesday 10 April 2002 08:54, Jim Koutoumis wrote:
> Using this method,.. works OK if you choose to save the file, however if
> you choose to open the file you get a weird behaviour where IE says it
> can't find the file and a subsequent prompt to create a new one. Does
> anyone know why it do
Using this method,.. works OK if you choose to save the file, however if you
choose to open the file you get a weird behaviour where IE says it can't
find the file and a subsequent prompt to create a new one. Does anyone know
why it does this and how to overcome it ?
At this stage I've resorted t
Try this:
As you give the client Content-Type: application/save-as - it will not know
what mime type the file is,
and the browser will give the user a save-as prompt.
This works in explorer - I haven't checked it in Mozilla etc - so you might
have to tweak it a bit.
Cheers
Scott
- Origina
On Tuesday 09 April 2002 11:20, Declan Kenny wrote:
> Hi folks,
>
> Ok I am trying to make a download area for files (including word files).
> How do I force a download of a word document rather than have it opening in
> IE?
>
> Declan
You don't. This option is set in windows exploror. as part o
22 matches
Mail list logo