Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-18-2011, 10:41 PM
da_judge's Avatar
da_judge da_judge is offline
 
Join Date: Jan 2006
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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))
{
Any ideas where im going wrong

Cheers
Reply With Quote
  #2  
Old 09-19-2011, 07:05 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 09-25-2011, 08:09 PM
da_judge's Avatar
da_judge da_judge is offline
 
Join Date: Jan 2006
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for reply...

Im after grabbing file... but not from database... as all my files stored in filesystem

Cheers
Reply With Quote
  #4  
Old 09-25-2011, 09:16 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 09-27-2011, 11:11 PM
souperman souperman is offline
 
Join Date: Mar 2011
Posts: 131
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 09-28-2011, 05:47 PM
da_judge's Avatar
da_judge da_judge is offline
 
Join Date: Jan 2006
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:52 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03568 seconds
  • Memory Usage 2,205KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete