Reply to Re: Fax server question.

Your name:

Reply:


Posted by Kamyk on 10/18/05 20:43

Uzytkownik "Steve" <googlespam@nastysoft.com> napisal w wiadomosci
news:1129655413.746951.251860@g43g2000cwa.googlegroups.com...
>
>> I would like to build up a web page, which will show me files, which are
>> fax
>> files (image files) (from fax server).
>
> We need more information on your setup. Are the descriptions to be
> stored in a database or a flat file? Sounds like you need two separate
> applications: a viewer application that lists the descriptions with
> links to the images; and a maintenance application that lets users add
> a description for a particular image.
>
> You don't say if the list is static or not, although you imply that at
> some time or other you don't know the file names. The maintenance
> application will have to scan the fax image files folder to see if any
> new files have been added. Collect the list of files from that folder
> and compare with the known list in your database/flat file. If there
> are any new ones, add them to your database.
>
> $faxlist = array();
> $fh = opendir( '/path/to/fax/files/' );
> while( false !== ( $file = readdir( $fh ) ) )
> {
> // exclude folders...
> if( $file != "." && $file != ".." && $file != "" )
> {
> // check file type...
> $path_parts = pathinfo( $file );
> if( $path_parts[ 'extension' ] == 'fax' ) // whatever the
> image ext is
> {
> // add to list...
> $faxlist[] = $path_parts[ 'basename' ];
> }
> }
> }
> closedir($fh);
> sort( $faxlist );
> reset( $faxlist );
> foreach( $faxlist as $faxname )
> {
> // print "<a
> href=\"showfax.php?faxfile=$faxname\">$faxname</a><br />";
>
> if( !exists_in_my_database( $faxname ) )
> {
> add_to_my_database( $faxname );
> }
> }
>
> Functions exists_in_my_database() and add_to_my_database() depend on
> your setup.
>
>> I would like have the files on the list on web page, because I would like
>> to
>> link the these image files
>> with some descriptions, which is taken manualy by a user. What is the
>> best
>> solution to link the file from fax server
>> with the descriptions.
>
> I would use a database to store filename and description, plus any
> other useful metadata that would be useful - such as file creation
> date, so that old fax files can be purged later.
>
> Don't store the image files in the database, it's a waste of resources.
> Leave them in the filesystem and save the filename only. Displaying the
> fax image depends on the image file format. If they are JPEG, GIF or
> PNG then use header() to tell the browser what type of image and the
> appropriate image output function (See
> <http://www.php.net/manual/en/ref.image.php>.) If they are TIFF, hmmmm.
> External application needed, I think.
>
> ---
> Steve
>

Sorry for not writing all information. The fax files can be added at any
time, so
the fax files names and numbers of the fax files changes dynamically. I
imagined
that there will be a refresh button to refresh the list of the fax files on
the web page.
Is it a good idea?

Yes, I know that storing images is not a good idea. I know that it`s better
to
store links of the files, but thanx for the answer.

Saying the descirptions of the fax files I meant the ID order which is
strongly
connected to this exact fax file and cannot be dropped. I think that the
best
idea would be to store the file names and ID Orders connected to them.

Thank you for the code.

Kind regards
M. from Poland

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация