The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Attachment help
Im workin on something to do with downloads... Im having trouble with it grabbing attachments..
Im using file system not db... this is the code im using... all files are 0 bytes Code:
//Getting attachment if ($vbulletin->input->clean_gpc('g','id',TYPE_UNIT)) { //attachment id $id=intval($vbulletin->GPC['id']); //select the content from the table $get_zip=$db->query_read("SELECT *FROM ".TABLE_PREFIX."attachment where attachmentid=$id"); // print the file while($_zip=$db->fetch_array($get_zip)) { Cheers |
#2
|
|||
|
|||
I'm not sure what you're trying to do. The code you have there gets an attachment record from the database but I don't see where you're trying to get the actual file data. You could look at attachment.php. In fact you may be able to use attachment.php to get the data for you instead of figuring out the details.
|
#3
|
||||
|
||||
Thanks for reply...
Im after grabbing file... but not from database... as all my files stored in filesystem Cheers |
#4
|
|||
|
|||
Right, I see where you said you're getting them from the file system, and you said they are 0 bytes, but you don't seem to have shown the code where you get the file name or try to read the file. The code you posted just looks like it reads a record from the db, so I don't how we can help you from that (but maybe someone else will, I don't know). I also don't understand if you still need help
|
#5
|
|||
|
|||
You would need to know how vb creates its directory structure. Since they don't want all your attachments in one directory, the attachments are split in multiple dirs. Once you find out the structure, etc. you can just pull the attachment ID and include it in a php file with the proper headers. You can't view the attachments directly, if that's what you're wondering.
|
#6
|
||||
|
||||
Basically its a multi download script...
It was working when i stroered files in database Now i store in file system... i get 0 bytes |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|