Re: [PHP] downloading files

2005-05-05 Thread Greg Donald
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

[PHP] downloading files

2005-05-05 Thread Cima
hi all, 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 the db and are referenced by an oid. the tab

Re: [PHP] downloading files

2004-08-23 Thread Aaron Todd
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

Re: [PHP] downloading files

2004-08-20 Thread Ramil Sagum
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

Re: [PHP] downloading files

2004-08-20 Thread Aaron Todd
hout real benefits). > > Teddy > > Teddy > > - Original Message - > From: "Aaron Todd" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, August 19, 2004 8:30 PM > Subject: [PHP] downloading files > > >> I posted a sim

Re: [PHP] downloading files

2004-08-19 Thread Octavian Rasnita
sword that can be used then by the script to allow access to that file (but this way might be more complicated without real benefits). Teddy Teddy - Original Message - From: "Aaron Todd" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 19, 2004 8:30 PM

Re: [PHP] downloading files

2004-08-19 Thread Mattias Thorslund
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

Re: [PHP] downloading files

2004-08-19 Thread Mario Micklisch
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

[PHP] downloading files

2004-08-19 Thread Aaron Todd
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 protected somehow. I h

Re: [PHP] Downloading files outside the webserver

2003-03-05 Thread Daniel Silva
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

Re: [PHP] Downloading files outside the webserver

2003-03-04 Thread Daniel Silva
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

Re: [PHP] Downloading files outside the webserver

2003-03-04 Thread Daniel Silva
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

Re: [PHP] Downloading files outside the webserver

2003-03-04 Thread Marek Kilimajer
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

Re: [PHP] Downloading files outside the webserver

2003-03-04 Thread Daniel Silva
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

Re: [PHP] Downloading files outside the webserver

2003-03-04 Thread Marek Kilimajer
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

[PHP] Downloading files outside the webserver

2003-03-04 Thread Daniel Silva
Hello, I'm currently working on a multi-user filemanager, on which each user has its space on the server and can do all the basic file operations we've all seen. I've looked all over the net and the manual, but I can't seem to find the solution for what I want. The system I'm creating keeps all

Re: [PHP] Downloading files - Plz hlp

2003-02-23 Thread Ernest E Vogelsinger
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

[PHP] Downloading files - Plz hlp

2003-02-23 Thread Anthony Rodriguez
Hi! 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? Thanks! Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Downloading files

2003-02-23 Thread Justin French
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

[PHP] Downloading files

2003-02-23 Thread Anthony Rodriguez
Hi! 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. How can the file be stored in C:\sample.txt, for example? Thanks! Tony -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] Downloading Files

2002-06-25 Thread John Holmes
> 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

Re: [PHP] Downloading Files

2002-06-25 Thread Francis
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

Re: [PHP] Downloading Files

2002-06-25 Thread Justin French
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

[PHP] Downloading Files

2002-06-25 Thread Francis
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 filesystem

Re: [PHP] Downloading files

2002-04-09 Thread Jason Wong
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

Re: [PHP] Downloading files

2002-04-09 Thread Jim Koutoumis
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 > - Original Message - > From: "Declan Kenny" <[EMAIL PROTECTED]> >

Re: [PHP] Downloading files

2002-04-09 Thread Scott Houseman
Scott - Original Message - From: "Declan Kenny" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 09, 2002 1:20 PM Subject: [PHP] Downloading files > Hi folks, > > Ok I am trying to make a download area for files (including word files). > How do I for

Re: [PHP] Downloading files

2002-04-09 Thread Matt Williams
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

[PHP] Downloading files

2002-04-09 Thread Declan Kenny
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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Downloading files/docs

2002-02-21 Thread Jim Koutoumis
Hi all, I've seen some posts and info elsewhere regarding downloading files - mostly stating problems with the way IE handles this function. What I'm trying to do is : 1 - offer files,.. .doc, .zip and others 2 - allow the user to click on a URL, or button 3 - have the options to Ope

[PHP] Downloading Files

2001-05-23 Thread Lee Denny
Apologies if this is a stupid question, but I'm trying to automate the download of a pdf file using PHP3. What I want to achieve is when a download button is clicked I update a simple DB and start the download. The problem I'm getting is that in Browsers with the Acrobat Reader installed the PDF