Results 1 to 9 of 9

Thread: Looking for a way to call a file without having a database

  1. #1
    Join Date
    Feb 2006

    Looking for a way to call a file without having a database

    I'm looking for a way for a user to get a specific pdf file by selecting three options from a group of choices (radio buttons maybe) on a web page without having a database.

    Any ideas?
    A picture is worth a thousand words, but it uses up three thousand times the memory.

  2. #2
    Join Date
    Mar 2011
    It's certainly possible to do what you want, but you haven't given enough information about how the PDF file would be selected. Can you give us an example of the options you have in mind and how they affect the selection of the PDF?
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Feb 2006
    Basically they would first select an industry. That would then give them the ability to select from a group of cameras and displays we build for that industry. Next they would choose the camera, display and controller they want to use form the available options. Once they have selected the three options they would get a PDF of that systems specs.

    With that they could possibly choose from 3 display models, 6 camera models, and 3 controller models.

    Does this offer enough information?

    A picture is worth a thousand words, but it uses up three thousand times the memory.

  4. #4
    Join Date
    Mar 2012
    To download a pdf file, dependent upon the three selections, you need to set up an array to link the options to the PDF file name. The logic can be written in PHP (which I prefer) or JavaScript.
    Last edited by jedaisoul; 04-30-2014 at 04:23 AM.

  5. #5
    Join Date
    Mar 2011
    Well, yes and no. I was focusing on the number '3' from your initial post and didn't expect there to be quite so many possible choices involved. From your explanation here, there would be (at least?) 54 possible combinations. That's going to take a bit of effort.

    What I should have explained is that some software will be required. You could certainly use something like a PHP script on the server to handle it, but I'd probably be inclined to embed some JavaScript in the page to do this unless there's some concern about keeping the location of the PDF files from being disclosed. Essentially, it requires a script that can match the selected options with a particular file. Your situation is a bit too complex to provide an off-the-cuff solution in my spare time here that you could easily adapt to your needs. Maybe someone else will chime in. Good luck!
    Rick Trethewey
    Rainbo Design

  6. #6
    Join Date
    Mar 2012
    it seems to me that the list of files could be greater than Rick estimates, because there are 54 combinations per industry, and an unspecified number of industries. Still, if once written the number of overall PDF files remains reasonably static, this could still be dealt with in an array without the added complexity of a database. However, the larger the array, the more I would opt for a server-side solution.

    Also PHP offers an alternative to having to amend the code every time a new PDF file is added, or an old one deleted (or even just a change to the title!). That is of storing the options in a CSV file, and dynamically creating the array. Then maintenance of the list of PDF files would be segregated from the maintenance of the code. You also have the option to maintain a list per industry, if appropriate. Assuming a list per industry, the CSV file could be something like:

    cam1,disp1,cont1,p111,p111.pdf,title,blah blah blah...
    cam1,disp1,cont2,p112,p112.pdf,title,blah blah blah...
    cam1,disp1,cont3,p112,p113.pdf,title,blah blah blah...
    cam1,disp2,cont1,p121,p121.pdf,title,blah blah blah...
    cam1,disp2,cont2,p122,p122.pdf,title,blah blah blah...
    Note: One issue with CSV files is that spurious commas can blow the building of the array. That is why the text description (if included) is put at the end of the line. If it happens to contain commas, they merely truncate the description, and the remainder of the line is ignored.
    Last edited by jedaisoul; 04-30-2014 at 05:03 AM.

  7. #7
    Join Date
    Dec 2002
    Seattle, WA
    there are pitfalls to using CSV, but there are work-arounds for those (using ";" as a delimiter, encapsulating strings with "", escaping delimiters in strings, etc.). XML is a often overlooked format for storing data. JavaScript can parse XML. You also have JSON format, JavaScript can parse this as well. Both are good transport methods. JSON is more loosely defined in comparison to XML. Depending on your needs either XML or JSON should work well.

  8. #8
    Join Date
    Feb 2014
    You're going to have at least 54 combinations, so if you're not open to a database, then I'd probably go for XML. Since it should be fairly straight-forward in that it's only reading (unless you're going to be adding files and they won't be static), then you could use PHP's simple_xml set of functions. A CSV can work just as well, however, I would use an uncommon delimiter, such as || just so any punctuation, ' ' or " " don't ruin it.

  9. #9
    Join Date
    Nov 2013
    You can do it. But you haven't mention about everything. Although download a PDF file is actually depends on three section. You have to learn about it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.10515 seconds
  • Memory Usage 2,931KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (9)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (72):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • bbcode_parse_start
  • postbit_imicons
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates