Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-04-2005, 04:18 AM
kompakt's Avatar
kompakt kompakt is offline
 
Join Date: Dec 2004
Location: FL
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Uploading to External Server

I'm trying to find a script that will allow uploading files to an external server, different from where the forum is installed. It will be an IIS server on a personal computer with 400gigz of space. There was a similar hack installed on vb2.

Thanks...
Reply With Quote
  #2  
Old 01-10-2005, 04:19 PM
kompakt's Avatar
kompakt kompakt is offline
 
Join Date: Dec 2004
Location: FL
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump... any ideas?
Reply With Quote
  #3  
Old 01-10-2005, 08:23 PM
scotty's Avatar
scotty scotty is offline
 
Join Date: Oct 2001
Location: Mannheim, Germany
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is the script I'm using to transfer my avatars to a different server - maybe that would be helpfull...

PHP Code:
<?php
$FTP_HOST 
="www.YOURDOMAIN.com";
$FTP_USER ="YOURUSERNAME";
$FTP_PW  ="YOURPASSWORD";
$FTP_ROOT_DIR="/";
$LOCAL_SERVER_DIR  "avatars/";
$FTP_DIR "REMOTE/DRICTORY";
$handle=opendir($LOCAL_SERVER_DIR);
while ((
$file readdir($handle))!==false)
{
   if(!
is_dir($file)){
       
$f[]="$file";       
     }
}
closedir($handle);
sort($f);
$count=0;
$mode FTP_BINARY
$conn_id ftp_connect($FTP_HOST);
if(
ftp_login($conn_id$FTP_USER$FTP_PW)){
   print 
"from: ".$LOCAL_SERVER_DIR."<br>";
   print 
"to: ".$FTP_HOST.$FTP_ROOT_DIR.$FTP_DIR."<br>";
   
ftp_pwd($conn_id);
   
ftp_chdir($conn_id,$FTP_DIR);
   foreach(
$f as $files) {
       
$from fopen($LOCAL_SERVER_DIR.$files,"r");   
       if(
ftp_fput($conn_id$files$from$mode)){
           
$count +=1;
//           print $files."<br>";
       
}
   }
   
ftp_quit($conn_id);
}
print 
"upload : $count files.";
?>
this script is scheduled by the admincp/cron once an hour.

scotty
Reply With Quote
  #4  
Old 01-11-2005, 01:35 AM
kompakt's Avatar
kompakt kompakt is offline
 
Join Date: Dec 2004
Location: FL
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks, I can see what your script does. The problem with this is that the attachments do not upload to the forum server as individual static files. So copying them to an external server might not do the trick. I'll need to embed this into the upload script somehow.
Reply With Quote
  #5  
Old 01-11-2005, 03:25 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do you mean they not upload as individual files?
Reply With Quote
  #6  
Old 01-12-2005, 12:14 AM
kompakt's Avatar
kompakt kompakt is offline
 
Join Date: Dec 2004
Location: FL
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes they do Marco. But they dont save as individual files on the server. The attachments have their own way of storage. I looked at the folder where they save to and it looks like this:

\attach\1\...9\

All the files are named ####.attach on the server. But within the forum, each file shows the origional attachment name as uploaded (.jpg, .txt, .mp3)
Reply With Quote
  #7  
Old 01-12-2005, 06:27 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the attachments are stored in the database, not in your storage.
thanks scotty for the script. You give me the idea how to upload from a server to another.

edit: it's possible to query a remote server from the local one, that way you can store attachment in your desired server and it's still use the database. but this requires a lot of changes I think.
Reply With Quote
  #8  
Old 01-12-2005, 06:33 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@deathemperor

Well vB give you the choice where to store them, in the database or in the filesystem.

@kompakt
They DO save as individual files if stored on filesystem. they are however not named the same as teh attachment. Wanted to research how to relate a filename on filesystem back to the attachment name, but never found time for doing so, but i guess others already have.
Reply With Quote
  #9  
Old 01-12-2005, 07:08 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh I thought I've seen it somewhere in vboptions ^^ but I was not sure.

by either way you have solutions...
Reply With Quote
  #10  
Old 01-12-2005, 07:25 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by deathemperor
oh I thought I've seen it somewhere in vboptions ^^ but I was not sure.

by either way you have solutions...
You can find this setting in ACP-->Attachments-->Attachment Storage Type

You can choose to store all your attachments in database or filesystem.

And no, i didn't give a solution.
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 07:52 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04570 seconds
  • Memory Usage 2,267KB
  • Queries Executed 13 (?)
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_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete