Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Files Download Restriction


Is there any way where i can restrict a file to download only 10 times.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
File Download Script With Restriction
I wanna create a script which will ahve the following abilities:

1] It should hide the actual location of file.
2] It should check if user is a premium member then no restrictions.
3] It should check if user is already downloading a file, or have downloaded a specified amount of bandwidth and if so, display errors.
4] Anti Leech Ability via 1 and more security to prevent hacking.


Now here is what's in my mind and how i am thinking it. Please correct me or suggest me alternative methods: Well i can do first, nothing much to wory about, will simply declare a variable with the value of where files are located and simply user get method to get the name/id of the file and simply redirect user to that file. So this will hide the location.

2 is not a big problem as well, i will simply connect to the db or introduce a new variable in session and check via that. 3 and 4 are somewhat problems.Have some idea about 3, : what if i set a cookie on client's PC? and then check it if it exists means user is either downloading or he hasn't reacherd the minimum time between two downloads. but user can clear his cookies to avoid this, so this isn't good, what else?

Session Based Access Restriction To Zip-files
How can you restrict access to some files (not PHP-files!) that are in one directory? I know .htaccess, but I'd like it to be session-based in one way or another, or cookie-based, so that I can control the user information through a database. Is there a way to do this?

I Can't See Any Dll Files In Php Download?
I downloaded the windows binary php4.0.4 from php.net and it says to move a certain dll file to your windows directory. I looked in the dll folder and it is empty. So, I tried downloading a php/apache package at a site just for windows users, and when I unzipped that package, I saw the dll files scrolling by in the unpacker window, but once again the dll folder was empty. Where are they?

How Do I Hide Files From Download Without Php?
I want to hide files or better say restrict access to them for usual download. I want to send them just to allowed users with php? How do I do that?

I've tried to put variuos permisions on the directory, and then run this code:
<?
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=file.rar");
$ff = fopen("restricted/anyName.zip", 'r');
fpassthru($ff);
?>

If there are any restrictions, user downloads only 400b file, if there's no restrictions user gets normal filesize.

Zip Files, Then Force Download
Is there any examples or scripts that already will do this?

I need to zip an arbitrary amount of files, say maybe a $files array full of path names to the files filled dynamically from database based on an id number...

then i need it to automatically force a download of the zip file to the browser, then automatically delete the zip file when its finished...

Select Files To Download
i have made a page with several photos of a party. There is a
index in the page, and under each thumbnail there is a checkbox. With
them people can select the photos that he's going to download, but i
don't know how i can send the selected photos. I think "compress" all
the selected photos in a file and send it, but i couldn't do it. I
used zlib and bz2 libraries, but i dont know how i can put more than
one file, and even with an only file the compress file dont work. What
i make is open the file, read it and then compress the string get of
the read in the new compress file, but this file is empty or have a
code of the zlib.

Corrupted ZIP Files During Download Via PHP
I am posting this rather lengthy description here in hope of getting at
least some insight into a problem that is really hurting my business,
since I have come to the conclusion that my problem is at least partly
PHP-related.

Some time now I have been having transfer problems, i.e. my customers
downloads of large binary (ZIP) files are often corrupt.

A corrupted file now and then can of course never be avoided, but I get
several complaints from customers every day. Of any specific file,
approx. 1 out of 4 downloads (larger than 100kB or so) are affected.
I have spent months trying to find the source of the problems without
success, but I have been able to rule out many possible causes. Here are
some facts:

1) The actual files are OK on the server. Direct (unencrypted) links are
fine, so it's not a general problem.

2) About 50% of the customers download (the exact same files) from
another source. I don't even get 1 complaint every two months from those
customers, while I get 1-3 complaints _every day_ from those who
download from my server.

3) The customers have various SW/HW/OS, so it's very unlikely that it's
a user problem. Plus, the same customer often download from both places,
but only have problems with the files from my server.

4) I have shut down all scripts for a while, so that only a static
website remained, but it didn't help.

5) I have had this problem on three servers: The present RaQ550, the
previous RaQ4 and the RaQ4 I had before that. So it's highly unlikely
that it is server-related.

6) I can easily reproduce the problem myself. As I looked into this I
found a systematic error:

Analyzing corrupt vs. clean ZIP file downloads with a binary/hex editor
clearly shows that the error is systematic. Clean ZIP files have a lot
of &#3900;h' bytes in them. In ALL of the corrupt ZIP files ALL (well, most)
of these bytes have been exchanged for &#395;C30h', i.e. TWO bytes ( 00h ->
5C30h ) !

Since &#395;C30h' equals an escaped zero, i.e. "", my guess is that there
is a translation error somewhere.

So, what does PHP have to do with this? Well, my download links to
purchaseware are encrypted by the PHP "ewportal":

From the few facts I have been able to uncover it seems there is
sometimes a problem with corrupted ZIP files depending on the
setting/compilation of ZLIB. If anyone on this forum have experienced
similar things I would very much appreciate if they could share.
My servers PHP configuration is at:

Protect Download Files
I´m developping an application that needs to show some videos, but in
a protected envinroment. Any user must be authenticated to see the
videos. But for example, if anyone know the path of the videos, can
access directly to this site and download it without authentication.

If I write in the location bar the url of a video, I can download
without problem because the application cannot test if the user is
already authenticated or not. I´ve read something about RedirectMatch
and it works well but now the users cannot see the videos.

I try to write an example:

..- #I write this rule in the httpd.conf
RedirectMatch (.*).avi$
/myapplication/tools/downloadfile.php?filename=$1

With this rule I redirect all the requests for the video files include
the request of a window media player, but I don´t want to do this.
When I show the video directly on the web, I don´t need to redirect
but when is a direct request from url to download the file, I must
check if the user is authenticated.



Browser Tries To Download .php Files Instead Of Executing Them
I'm running Redhat 9 and just upgraded from PHP 4.2.x to 4.3.1 and no
when I try to execute a script on my local server here it opens a
window to try and download any .php files. I think Apache isn't
loading the module, but when I add in:

LoadModule php4_module modules/libphp4.so

it can't find the module and I can't find it on my system under
libexec or modules or anywhere else for that matter. What do I need
to do to httpd.conf (or php.ini) to make it execute these scripts?

User Download Files From Database
I make a code to Download file userfiles from database these are userfiles, admin upload files and user download it from the database,but there is little problem i can't fix it Code:

Download Files Quickly = Hang
This isn't exactly a PHP-related question, but I'm hoping that the
community of developers here will have experience dealing with it. We
want to allow users to view large files on our site, but we've realized
that if users in IE click from one file to another too quickly (before
the previous files have fully loaded), future files do not load until
they close and reopen their browsers. We believe this is because of
the two-concurrent-downloads limit -- apparently Firefox correctly
recognizes when a download has been abandoned on the user's end, while
IE does not, and this causes problems.

A Follow-up To My Download-all-files-as-a-zip-file Post
I made a script that successfully creates a .zip file of all the files
in a directory on my web server, but now what I haven't figured out
how to do is how to have it automatically deleted when the user
successfully downloads it, as otherwise my server would eventually get
clogged up with all these zip files.

Download-scriptto DL Files Outside The Public_html Folder
I have a small Linux webserver, and want to find a (php) script
that lets my users download files located outside of the public_html
folder.

Download Link For Exe Files Dont Work!
i'm developing a php app that shows folders and subfolders with their content so someone can download files from those browsers. the problem is: the download does not work for exe files!

http://www.scotland.ca/dmspro/_uplo...4Std_Manual.PDF
works and
http://www.scotland.ca/dmspro/_uplo...-%20netants.zip
works too! but
http://www.scotland.ca/dmspro/_uplo...ils/wrar320.exe
and
http://www.scotland.ca/dmspro/_uplo...ISO_v6_5_en.exe
do not work!!!

where could be the problem there??

Creating Download Manager For Multiple Files
Has anyone run across some sort of download manager to be able to download multiple files at a time via http with PHP? I run a mp3 site and I would like to be able to allow people to download whole folders at a time basically the same functionality as ftp but with http. It would be kind of like the smart download thing that netscape has but cross platform compatible. Any ideas?

Allowing Users To Download Files Using Headers
I am trying to create an area where a user can come to a page that
queries a database and displays links to files. Here is the code for
the link:

<td><a href="download.php?path=../ftp/$path&name=$name"
target="_blank">$name</a></font></b></td>

Quote:

Download Files From Remote Server To Local Webserver
I am trying to create a php page whereby people can download files from a remote server to their own server (to update their webdirectory with updated files/images etc). So for example one php page (e.g. update.php) should be able to download files from a remote server to a specific directory on their local webserver. Is this possible?

How To Allow Downloaded Files To Be Splitted When Using A Force-download Script ?
I suppose you all know force-download scripts. The problem is that
these scripts don't allow files to be splitted when downloading them
via a download manager.
I've found a solution to enable download resuming, but now, it remains
the splitting problem. Does anyone have any idea ?

Display Files Inside A Directory? With Download Button.
My first version of simple code, display files and directories but when i tried only to display pdf files and subdirectories inside the given path, with pagination and downloadable option, everything went wrong. Code:

Curl - Resume Http Download - Apache Log Files. Gz
I am writing a Php script to run on my home PC (Windows) that downloads an Apache access log file and inserts new entries into a database.. The only way I can access these log files is through a cPanel URL that delivers a gzipped copy of the log file with all entires for the current month (up to the current date and time).

I want to run this script once a day (at night) and would like to download the gzipped file by resuming from where I left off the day before (instead of always downloading the entire gzipped file).

I have tried using CURL with the option - curl_setopt($ch, CURLOPT_RESUME_FROM, $prev_offset) - but that always restarts the download from the beginning. ($prev_offset is the previous days file size).

I'm not sure what the structure of a gzip file is, so I don't even know if it is possible to resume a gzip file download when the file has been rebuilt in the mean time (cPanel creates a gzipped file with the same name from the raw log files every time you access that page in cPanel). My guess is that this is probably not possible. ... But .... I am trying to make the resume work to find out for myself and I can not make
the resume work.

The bottom line is that I am trying to avoid downloading the entire gzipped log file every time I need to download it.

As an alternate, I have been successful using gzopen, and then I can gzseek to the previous offset, but I am unable to use a secure URL (https) with the Zlib functions (gzopen) with my Windows version of Php (the username and password have to be included in the cPanel URL to access the log file, so I'd like to use SSL.)

(I have started another thread to figure out how to get a Php Windows binary with https and ftps as registered streams (built with --with-openssl in the ./configure command), but so far I have gotten no replies).

Question: When using gzread, where does the decompression take place - on the server where the file is located, or on my PC after the compressed data is downloaded? Does gzseek work on a compressed file, or must it be uncompressed on the server first? The point being; when I use gzopen and gzread, am I downloading compressed or uncompressed data from the server where the log files are located?

I can use either method, but want to meet two requirements.

1. I do not want to download redundant (old) data every day (I want to resume where I left off) ... and ...

2. I want to send the request for the log file (containing a username and password) using SSL.

Automatic Download Of Files Using Application/save On Windows XP SP2 Browsers
For the past two years, we have offered files for download through a
secure website. Users, after clicking on a link, are redirected to a
PHP page that passes the appropriate header information to the user
and inquires if that user wishes to download the file.

A sample of that code is below:

header('Content-Type: application/save');
header('Content-Disposition:attachment; filename="'.$file_path .'"');
header('Content-Transfer-Encoding: binary');
header('Content-length: ' . filesize($full_file_path));
readfile($full_file_path);

However, with the enhanced security now available in Windows XP SP2,
users are no longer prompted to download the file. In fact, Windows
XP SP2 not only suppresses the download but will not even present the
end user with an option to download the file. Has anyone else
encountered this type of situation? If so, is there a programmtic
solution to, at the very least, prompt the user to download the file
without requiring the user include the website as one of his/her
trusted websites.

Url Restriction
With the content management system I'm working with, I have it set up to display urls like "index.php?dir=uploads" the problem is, some one can go "index.php?dir=../../"
I am thinking a preg_replace, or something similar. any ideas? maybe somehow set "dir=uploads" as the max folder to go back. Code:

Cookie Restriction
I've read that php can only handle 20 cookies /server. Is this true?

We want to have many people logged in at the same time and every page checks in the cookie if the user is logged in. And we do want to have "way" more than 20 users logged in at the same time.

No Open_basedir Restriction
What should I put into my hta.acess file in order to make it so there is no open_basedir restriction for the php. I have asked my host, and they told me to search for it but I couldn't find it. I currently have PHP version 4.4.7.

Open_basedir Restriction In Effect
on a virtual host, I get the following warning:

Warning: is_file() [function.is-file]: open_basedir restriction in effect.
File(/usr/local/httpd/htdocs/kunden/web46/html/images/1041.jpg) is not
within the allowed path(s):
(/usr/local/httpd/htdocs/kunden/web46/) in
/srv/www/htdocs/web46/html/jobholder/userdata.php on line 105

I read the documentation but the the warning makes no sense to me, because
it's obviously wrong. The tested file is within the allowed path!? Any hint?
If I call phpinfo() it shows /usr/local/httpd/htdocs/kunden/web46/ as
open_basedir.

Open_basedir Restriction In Effect
I recently reconfigured open_basedir so that it wasn't quite so limited.
Now, I'm getting erros with php script that use to run fine, and I can't
figure out what went wrong.

Previously, open_basedir was configured (locally) like so:
/home/httpd/vhosts/mydomain.com/httpdocs/:tmp/

I changed it to
/home/httpd/vhosts/

Now I get the following errors:

Warning: open_basedir restriction in effect. File is in wrong directory
in /home/httpd/vhosts/mydomain.com/httpdocs/admin/uploadarticle.php on
line 192

Warning: fopen("fileupload/Aleph One Log.txt", "r") - No such file or
directory in
/home/httpd/vhosts/mydomain.com/httpdocs/admin/uploadarticle.php on line
193

Warning: stat failed for fileupload/Aleph One Log.txt (errno=2 - No such
file or directory) in
/home/httpd/vhosts/mydomain.com/httpdocs/admin/uploadarticle.php on line
194

Warning: fread(): supplied argument is not a valid File-Handle resource
in /home/httpd/vhosts/mydomain.com/httpdocs/admin/uploadarticle.php on
line 195

These are the lines of code:

192 copy ($_FILES['quarkfile']['tmp_name'],
"fileupload/".$_FILES['quarkfile']['name']);

193 $open=
fopen("fileupload/".$_FILES['quarkfile']['name'], r);

194 $filesize =
filesize("fileupload/".$_FILES['quarkfile']['name']);

195 $wholefile = fread( $open, $filesize );

My Access Level Restriction
I have currently 6 access levels on my site.. 0, 10, 20, 30, 40 and 50.. I want to restrict what each level can view in the control panel.. this is how the code looks at the moment: Code:

PEAR Gives Open_basedir Restriction On IIS Server
On a previous installed server my site which uses several PEAR-packages
worked fine. Now it's transfered to a new server. (Both servers installed with
Windows 2003 / IIS 6, on the previous server the PHP version was 5.03,
on the new one 5.05)

The site gives a open_basedir restriction on this new server. In the
php.ini the open_basedir line is commented, but when I run the command
phpinfo() there appears to be a local value, which I didn't set. Does
anyone know how to solve this problem, or some things I can try?

Here is the output of phpinfo();

include_path .;C:phppear;c:php .;C:phppear;c:php
log_errors On On
log_errors_max_len 1024 1024
magic_quotes_gpc Off Off
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
mail.force_extra_parameters no value no value
max_execution_time 45 45
max_input_time 60 60
open_basedir D:webspaceweb32xxxxxxx no value

This is the error on my site :

Warning: main() [function.main]: open_basedir restriction in effect.
File(C:phppear/PEAR/HTML/QuickForm.php) is not within the allowed
path(s): (D:webspaceweb32xxxxxxx) in
d:webspaceweb32xxxxxxwwwincludes.php on line 12

Warning: main(PEAR/HTML/QuickForm.php) [function.main]: failed to open
stream: Operation not permitted in
d:webspaceweb32xxxxxxwwwincludes.php on line 12

Fatal error: main() [function.require]: Failed opening required
'PEAR/HTML/QuickForm.php' (include_path='.;C:phppear;c:php') in
d:webspaceweb32xxxxxxxwwwincludes.php on line 12

Warning: Open_basedir Restriction In Effect.
Warning: open_basedir restriction in effect. File is in wrong directory. in /usr/local/httpdocs/admin/includes/application_top.php on line 175 this error is new to me.

Restriction On Passwords: Min 5 Chars, Must Contain 2 Numbers
How do I place restrictions on passwords, such as a minimum of 5 characters, containing at least 2 numbers.

How To Fix Open_basedir Restriction In Effect... Problem
I've been searching on the internet for some time now and I was not
able to find a solution to this problem.

under apache httpd.conf file I have the following setting
php_admin_value open_basedir
"/home/httpd/vhosts/domain.com/httpdocs:/tmp"

I understand that open_basedir will display an error when the file I am
trying to deal with is outside the directory set, however that's not
the case all my php files reside under
/home/httpd/vhosts/domain.com/httpdocs and I am still getting this
error.



Warning: Fopen(): Open_basedir Restriction In Effect.
I am writing a PHP script that connects to an FTP site and downloads a file. I find that I can only write to the public HTTP directory when I turn the Group Write permissions on. However, I am concerned about security.

I tried creating a directory outside of the public HTTP directory, with Group Write permission as I was told that this is more secure. However, I received the following error:

Warning: fopen(): open_basedir restriction in effect. File(../lsr/addendums.txt.gz) is not within the allowed path(s): (/var/www/vhosts/mydomain.com/httpdocs:/tmp) in /var/www/vhosts/mydomain.com/httpdocs/lsr_ftp.php on line 69 PHP Code:

Copy(), Move_uploaded_file(): SAFE MODE Restriction In Effect
Is there any way to get around a safe mode and upload and move files?

What I need to do...Upload file...Move to images...Put file name in mysql db ... I know how to do all this, but when trying to move the file..

Using Move_uploaded_file

arning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid is 32038 is not allowed to access / owned by uid 0 in /home/chasesch/public_html/client/admin/upload.php on line 4

Using copy() and unlink()

Warning: copy(): SAFE MODE Restriction in effect. The script whose uid is 32038 is not allowed to access / owned by uid 0 in /home/chasesch/public_html/client/admin/upload.php on line 5

Global Turned Off & SAFE MODE Restriction In Effect
I need a Host based in North America that will allow Global settings
to be on and the Safe Mode restriction off...

Warning: Mail(): SAFE MODE Restriction In Effect.
Could the new PHP bug that results in SS includes reporting a streaming data error be associated with the SAFE MODE option? I have one host running my script perfectly with no errors, and the other host (with safe mode enabled), reporting the include error?!?

Also, is there a way around the following error when running safe mode:

Warning: mail(): SAFE MODE Restriction in effect. The fifth parameter is disabled in SAFE MODE. in /www/displaycasestor.com/www/bin/test/order-online-new-results.php on line 338
Code:

Warning: Main(): SAFE MODE Restriction In Effect.
There are 2 values for safe_mode . Local and Master. Why is local value OFF and Master value ON. I want my safe_mode to be OFF on server, becoz it is giving me this error:

Warning: main(): SAFE MODE Restriction in effect. The script whose uid is 33 is not allowed to access ../../../../library/CConnection.php owned by uid 0 in /var/www/vhosts/default/htdocs/publisher/abhi1234/Tv_today/issue2/magazine.php on line 2

Warning: main(../../../../library/CConnection.php): failed to open stream: Success in
/var/www/vhosts/default/htdocs/publisher/abhi1234/Tv_today/issue2/magazine.php on line 2

Warning: main(): SAFE MODE Restriction in effect. The script whose uid is 33 is not allowed to access ../../../../library/CConnection.php owned by uid 0 in /var/www/vhosts/default/htdocs/publisher/abhi1234/Tv_today/issue2/magazine.php on line 2



Advanced Filesystem Usage (Warning: SAFE MODE Restriction In Effect.)
I'm working on the automatic News insertion functionality, which is simple enough in itself. But where I'm having the problem is dealing with uploading image files. Since we use screenshots from in game as pictures to give viewers a more interesting view of what the news article is about, I need to be able to store images for the news files on the server.

Now, I could store all the images in one images folder, but I wanted to do something different. Which, with the form that I created to allows uploading of images, it will store them in a subdirectory of the images/ folder that is similar to the current date they were uploaded on. ie today would go into "images/04.15.03/file.gif" basically.

I'm authenticating the uploaded file fine from what I can tell. The hard part first came in getting the subdirectories to be created with the mkdir() command. At first it just wouldn't do it, after trying several ways. Finally I figured out I had to change the priveleges of the directory on the server. After that I was able to create subdirectories in PHP. Problem is, I'm using move_uploaded_file() which is considered safer and works better in safe mode. But I'm recieving the following error.

Warning: SAFE MODE Restriction in effect. The script whose uid is 547 is not allowed to access /%mybasedir_hiddenfrom you%/images/04.15.03 owned by uid 48 in /%mybasedir_hiddenfrom you%/classes/class.files.php on line 225

The line it points to is the move_uploaded_file() function. From what I've heard through safe mode you can't upload to dir's you create or something due to the owner of them. But I already set the created dir to full priveleges.

I'm wondering if there is a way to sort of log into the apache server via php and create the directly as the site owner that way. Here are the code snippets: PHP Code:

Open_basedir Restriction In Effect. (unlink(): Open_basedir)
unlink(): open_basedir restriction in effect. File(/httpdocs/userImgThumb/) is not within the allowed path(s): (/var/www/vhosts/blah/httpdocs:/tmp) in /var/www/vhosts/blah/httpdocs/pages/myimages.php on line 105

This error comes about when using unlink() within a php script to remove a file. the path to the file is also correct.

Including Files In Different Direcories That Include Files From Teirs
Okay, I made a simple AJAX shoutbox and I want to include it on all my pages. To insert the shoutbox I simply type <? include('/shoutbox/shoutbox.php');?> into my HTML page.

The problem is, that in /shoutbox/shoutbox.php I also include settings.php, functions.php, and some other files, and when I include /shoutbox/shoutbox.php into my index page, /shoutbox/shoutbox.php tries to call settings.php from the same folder that my index file is in, since I just 'included' it in index's source.

So my question is, is there any way, without using frames, to include a PHP file as it would be if you link directly to it in the address bar, but placed into another file in a different directory?

How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page:

<?php require_once('Connections/conn.php'); ?>

I want to hide the connection file, "conn.php", so it's out of the web
accessible file structure. I understand putting them in the php include
directory shoudl do this. For example, let's say the directory I put them
in is /www/phpIN/, and /www/ht/ is the root web directory.

So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and
removed it form CONNECTIONS directory.

How Do I Hide Database Connection Files Using PHP Include Files?
I have the following at the beginning of the PHP page:

<?php require_once('Connections/conn.php'); ?>

I want to hide the connection file, "conn.php", so it's out of the web
accessible file structure. I understand putting them in the php include
directory shoudl do this. For example, let's say the directory I put them
in is /www/phpIN/, and /www/ht/ is the root web directory.

So I put "conn.php" in the inlcude directory (/www/phpIN/conn.php) and
removed it form CONNECTIONS directory.

Now it doesn't work.

What do I need to change?

Creating Dir, Copy Files And Pass Variables To 2 Files
I need to create a folder on the server weekly named by the user. To this folder copy the contents of an /Original folder. Inside the new folder edit one of the files to insert a data with a XML path generated in another application, copied (via memory) and pasted within the very first form and passed to the file in question.

<param name="FlashVars" value="xmlfile= $lanofile" />

the $lanofile is the value that I need to pass from the form to be read by this file.
I have created an form (n.php) that POST the name of the folder to a second file (creatdir.php) everything is cool until I have to edit the third file.

How can I pass the value of one of the formfileds to a second file and them read this value as a variable to be consumed as mentioned above? Or actually right whatever is on the third field to this position (not using variables).

How To Detect Number Of Files And Files' Name In A Folder?
I have a server built in window + apche. I am trying to make a photo album, but I don't know what is the code for detecting the number of files in a server folder and the files' name~.

Upload Audio Files Of Type .wav & Video Files Of Type .avi
I need to upload audio files of type .wav & video files of type .avi
/ .mov but my current file unloader is not helping me with that. My
unloader works with application types, images, txt, pdf , mp3, mpg,
mpeg but not with those .wav & .mov/.avi files........

Ftp Download Using Php
i need to implement a ftp download using php. i am using the ftp_get function to implement it. PHP Code:

Zip Download
please check this code i am trying to give users the ability to download zip
files

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".$length);
header("Content-type: multipart/x-zip");
header('Content-Disposition: attachment; filename="'.$filename.'"');
readfile($filename);

but the zip file download and shows size 4 mb but there is no file in the
zip and it does not extract and says its corrupt i know its not corrupt because if i download the same file from ftp it works fine only downloading by using this code gives this error ...

Download Jpg
I need to see how to download a JPG directly without using zip files by example. If you click to donwload pictures you can download directly a JPG. They use PHP to do the trick, so my question is if somebody know how it can be done.

Download
I have a script that download any file to the user according to the
parameters.
I call the script like this:
download.php?file=xxx/myfile.doc&file_short=myfile.doc

My script is working fine except with N4.7
It opens the download box, but the name is download.php instead of
myfile.doc
I found the same bug with N7 on the Net. The workaround is to call the
script with "/" :
download.php/?file=xxx/myfile.doc&file_short=myfile.doc

It solves the problem with N7, but with N4.7, the only difference is with
the name. Now it is :
download_php.htm

If I specify the content type related to the file, it works fine. But I
can't do that because the file type can be anything.
It can be a word, excel or pdf file etc etc
Do you have any idea or a script to automatically set the content-type
according to the file extension ?

here is my script:
Header("Content-Type: application/octet-stream");
Header("Content-Length: ".filesize($_GET['file']));
Header("Content-Disposition: attachment; filename=".$_GET['file_short']);
readfile($_GET['file']);

Download
I need a simple php file that download all files and folders
located in the web directory, it means that with a single file in the
website, with just a click it download all files and folders.
How Can I do that?


Copyright © 2005-08 www.BigResource.com, All rights reserved