View Full Version : attachmenttype and extension and mimetype
Moodeey
11-20-2005, 06:38 AM
im lost on a vbmod that im doin im not sure what the line of code would be for this idea i have in mind...
what im doin is im trying to make a .zip viewer mod where a user could click on a drop down and view the contents of a .zip file (Attachment) this mod uses the "postbit_attachment" template and showthread.php file..
my question is how would i just call a query for just .zip files only ?
please help
Marco van Herwaarden
11-20-2005, 06:53 AM
You could select on the extension column.
Moodeey
11-20-2005, 06:54 AM
what do u mean ?
Marco van Herwaarden
11-20-2005, 07:00 AM
SELECT * FROM attachement WHERE extension = 'zip';
Moodeey
11-20-2005, 07:10 AM
thanks just one more thing how would i call the attachmentid for the .zip file ? or each zip file ?
would this work ?
$DB_site->query("SELECT * FROM attachement WHERE extension ='zip' ORDER BY id");
Marco van Herwaarden
11-20-2005, 08:17 AM
Are you coding for 3.0 or 3.5?
Moodeey
11-20-2005, 08:26 AM
only for 3.0.X
Marco van Herwaarden
11-20-2005, 08:39 AM
Then there is no extension column, you would need to determine the type yourself.
Maybe with a:
SELECT attachmentid FROM attachment WHERE filename LIKE '%.zip';
Moodeey
11-20-2005, 05:43 PM
well here is the start of the code here
header('Content-Type: text/html; charset=windows-1256');
$dir = $DOCUMENT_ROOT.dirname($PHP_SELF);
$file = ' WHAT DO I PUT HERE ';
$zip = zip_open($dir.'/'.$file);
where do i put the query ?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.