vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   saving images to a MySQL database (https://vborg.vbsupport.ru/showthread.php?t=54909)

Brad 07-09-2003 07:18 AM

Demuro, I dont have time to answer all your questions but ill get a few.

Quote:

ok so this I take it stores the info in a directory...Right?
Yes

Quote:

what is the directory name?
Its defined here:

PHP Code:

$newfile "/home/pathto/public_html/yourfoldername/".$userfile_name

Just change yourfoldername in the code to whatever you want :)

Quote:

and is it possible to name the file manually, say by adding more form fields
I would recomend naming them with a md5 hash, its just that much secure. Check out scott's attachments as files hack. Im sure you can get the needed code from it.

Quote:

is there a way do view the directory say through the SmartFTP program I use and if so how do I do that
of course, its lives on your server just like your forum directory

Quote:

do I just add a php/MySQL insert staement to insert the name into my database and then use it as a pointer?
Yep :)

DeMuro1 07-09-2003 07:48 AM

I swear you guys have got to be the smartest lot in the universe. I so from your info anime loo I know how to do everything else I want.

Thank you all so very much
I am extremely greatful

Gavin B. 07-09-2003 11:02 AM

Quote:

Today at 09:48 AM DeMuro1 said this in Post #12
I swear you guys have got to be the smartest lot in the universe.
:banana: I try my best :D lol

Lesane 07-09-2003 11:27 AM

Quote:

07-07-03 at 02:25 PM Mist said this in Post #4
I've always wondered how people upload the files directly into the database though. I mean the attachments in vb aren't stored in a temporary directory are they?

I can create the form with a pointer to the file easily enough but uploading directly to the database is out of my league at the moment. Any tutorials or anything?

- miSt

Mist, this tutorial will probably help you:
http://www.devarticles.com/art/1/68

Dean C 07-09-2003 02:39 PM

Excellent Lesane - thankyou :)!

- miSt

Lesane 07-09-2003 03:22 PM

You're welcome, once you readed that tutorial you probably think 'aah never thought it would be that easy' ;)

DeMuro1 07-10-2003 08:32 AM

last question I hope

if I modify this line
PHP Code:

&& $userfile_type == "image/jpg" 

to read
PHP Code:

&& $userfile_type == "image/file type I want" 

can I upload any type of file?

and if I add succesive strings of this
PHP Code:

&& $userfile_type == "image/file type I want" 

Then I should be able to upload multiple types of file.

is that right or does this upload only work with jpg images? If it does how can I allow it to upload gif images?

Thanks

and again can I I list you on my site as having written this portion or would you rather remain annonymous?

Gavin B. 07-10-2003 11:04 AM

Yes, you can change that to be whatever you like. Just be careful you don't allow any sort of files which could possibly be dangerous.

.gif, .png and jpg are the common extensions I would check for. :)

Gavin B. 07-10-2003 11:07 AM

Quote:

Today at 10:32 AM DeMuro1 said this in Post #17
and again can I I list you on my site as having written this portion or would you rather remain annonymous?
It's only a snippet, I'm sure there's a zillion variations of it floating around, so personally I don't want credit for it. :) Hope it helped out though.

Dean C 07-10-2003 03:01 PM

Wow that upload script was easy to use. Only problem was that when uploading images only part of the image was uploaded so there's a little bug there. But apart from that i understand the concept :)

- miSt


All times are GMT. The time now is 04:34 PM.

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.01139 seconds
  • Memory Usage 1,755KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete