Gossamer Forum
Home : Products : Links 2.0 : Customization :

File Info

Quote Reply
File Info
I am looking for a script that shows info of a file.

Like I am makeing a download site where user can download mp3s. In the detail page i want to put the info of the mp3s like



1 - If the file is dead or not
2 - Url of file
3 - Domain name of server hosting the file
4 - File Size
5 - File Extension
6 - And Tag for the mp3 file If possible

I ve see a php program like that couple of months ago but cant find it now.

Does any of you guys know such program that can be used by SSI calls.

Any kind of help is appreciated.


---------------------
0 0
|
-_-
Quote Reply
Re: File Info In reply to
1 - If the file is dead or not

Why would you want dead link in the directory anyway?

2 - Url of file

Use <%URL%>

3 - Domain name of server hosting the file

<%URL%> ?

4 - File Size

I don't think you can do that unless they add it when they submit the mp3 - you'd need a new field called "Size" or something, then put <%Size%> in link.html

5 - File Extension

You already know it is mp3

6 - And Tag for the mp3 file If possible

Could you explain a little more about 6?

Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com

Quote Reply
Re: File Info In reply to
File's extencion can be varied cause some time user upload a mp3 file but the name of the file could be " name.doc , name.gif " it is a mp3 file but some host dont want the user to upload a mp3 file so that the user changes its extencion, and about the size i think no one knows the exact size so if a script checks the file size that would be accurate and its like the live stats of a file like the file is available or not because i update the database every other day so if i checked the file yesterday it was good and today its not. About the tag all the mp3 files have a tag in it that contains info about the song, author, bitrate, the year album was released and etc.

---------------------
0 0
|
-_-
Quote Reply
Re: File Info In reply to
I think you'd need several new fields for that unless you had a textarea where people could insert info about the songs.

As for detecting the file extension, you could use regex on the URL....

$in{'File_Ext'} = $in{'URL'};
$in{'File_Ext'} =~ s/^.+(\.\w+)$/$1/i;

(you'd need a new field File_Ext and you'd add that code in add.cgi before the data goes into the database).

I'm not sure how you'd go about detecting file size - it is simple if the file is on your server but as it isn't then I'm not sure how you'd do it.

Installs:http://wiredon.net/gt
FAQ:http://www.perlmad.com

Quote Reply
Re: File Info In reply to
about the extension and the domain name of the server you can see any example here

http://www.mp3webmaster.com/download/?id=42480

---------------------
0 0
|
-_-