PHP Media Download Library

I am currently looking for a media download library for PHP that can manage several types of files. Either one library or a combination of different functions will work equally well.

I could write simple download code that checks the file type and includes some simple security measures, but I would prefer to leave it to someone more qualified.


Functions I am looking for in such a library:

  • Check file type. . I would like the library to have a white list of the types of files that can be downloaded, and to check if the downloaded file is really a white list. The verification process will have to do more than just check the file extension. Example: only .jpg, .png, .mp3, .avi downloads are allowed.

  • Either a page with advanced options / section or clear and editable code. . I would like to be able to format the library so that it matches the structure of my site, and not vice versa.

  • Security Checks. I would like to have a security check system in place to make sure that the files are not a security risk for my site.

  • Free. I would rather not buy a library.


Tools I have found so far:

Due to the universal need for code to download files, there are many downloadable libraries, such as:

The problem is that there are so many libraries, frameworks and classes that it is difficult to choose one (or several for collaboration) and know that it will be reliable and efficient.


So, it would be great if I could get some recommendations on what, in your opinion, is best for downloading PHP libraries or libraries for PHP that contain the functions I'm looking for!

Thank you, ton!

+4
source share
1 answer

Well, it only depends on what you want to download. Are these just images? Text files? Video

In any case, the library is not really needed, because PHP has a very powerful built-in download function.

This page shows a good example of how to make a basic form and perform some basic security checks, including checking the file extension. PHP is very safe, although you will have to decide which file extensions you will accept. As a general rule, it is best to choose exactly what you accept, rather than limiting just a few high-risk files. For example, if they are not needed and you want to support them, avoid supporting archives (e.g. 7z, bz2 or zip) or executable files.

In addition, if you want to put a very simple virus scan into a recently downloaded file, you can use a method similar to this one .

Do you want to combine your site around the desired library? Using PHP allows you to do this best, and it's relatively simple.

0
source

All Articles