dcsimg
www.webdeveloper.com
Results 1 to 8 of 8

Thread: Visitors Uploading Files To My Website

  1. #1
    Join Date
    Mar 2017
    Posts
    4

    Visitors Uploading Files To My Website

    I'm currently creating an HTML website for my printing business. However, I have never created a website that allowed users to upload files. I do not want the files to be seen by other users, but to be uploaded for me to receive them on the back end for printing. Files can range from as simple as a brochure, which can be small, to a poster, which can be quite large. What would be the best way to handle this, or is this even possible with html? Thanks so much in advance!

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    22,030
    HTML can be used to create a file upload form in the user's browser, but you'll need actual programming on the server side to do anything with the upload, manage user accounts, etc.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Mar 2017
    Posts
    4
    Quote Originally Posted by NogDog View Post
    HTML can be used to create a file upload form in the user's browser, but you'll need actual programming on the server side to do anything with the upload, manage user accounts, etc.

    Ok, that's awesome to know!

    How my next question, programming such as? FileZilla, etc.? And if so, do you know how I would link that to the HTML form?

    Thanks again!

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    22,030
    No, programming as in PHP, or NodeJS, or Ruby, or Python, or Java, or C#, etc.: you'll need a script on the server that the form sends its data to (including the file upload), and that script will then do whatever it is you need. It will likely need to move the file to some predetermined directory on the server, possibly put some information in a database about that file and relating it to the user who uploaded it, perhaps send you an email, and everything else you need the application to do when a user submits the form -- not to mention you may need some sort of user registration and login functionality, as well.

    If that's all just a bunch of mostly meaningless words to you, then you probably want to either see if you can find a ready-made package of code that does what you want and can be run on your web server (maybe free, maybe not if you need something really good), or consider locating/hiring a developer/team to build it for you.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  5. #5
    Join Date
    Mar 2017
    Posts
    4
    Quote Originally Posted by NogDog View Post
    No, programming as in PHP, or NodeJS, or Ruby, or Python, or Java, or C#, etc.: you'll need a script on the server that the form sends its data to (including the file upload), and that script will then do whatever it is you need. It will likely need to move the file to some predetermined directory on the server, possibly put some information in a database about that file and relating it to the user who uploaded it, perhaps send you an email, and everything else you need the application to do when a user submits the form -- not to mention you may need some sort of user registration and login functionality, as well.

    If that's all just a bunch of mostly meaningless words to you, then you probably want to either see if you can find a ready-made package of code that does what you want and can be run on your web server (maybe free, maybe not if you need something really good), or consider locating/hiring a developer/team to build it for you.

    Ahh, I see. So I can create the form with html, but link the form with some .php coding to get it to function. And there wouldn't be any file size limitations unless I set them correct? Also, is there any way possible I can do this without having the user register? I would just like a section on one of my pages to have the form where anyone can just submit a file. If this isn't possible, that's ok, but I just wanted to make that a last resort. Thanks a bunch!

  6. #6
    Join Date
    Mar 2017
    Posts
    4
    Quote Originally Posted by NogDog View Post
    No, programming as in PHP, or NodeJS, or Ruby, or Python, or Java, or C#, etc.: you'll need a script on the server that the form sends its data to (including the file upload), and that script will then do whatever it is you need. It will likely need to move the file to some predetermined directory on the server, possibly put some information in a database about that file and relating it to the user who uploaded it, perhaps send you an email, and everything else you need the application to do when a user submits the form -- not to mention you may need some sort of user registration and login functionality, as well.

    If that's all just a bunch of mostly meaningless words to you, then you probably want to either see if you can find a ready-made package of code that does what you want and can be run on your web server (maybe free, maybe not if you need something really good), or consider locating/hiring a developer/team to build it for you.
    Here's an example of the kind of function I want for my site. You see here:

    http://cantondataprint.com/upload-files-form/

    They have a page with a form where a user can upload forms without signing up. I would like the same kind of functionality, only more of an updated look, which is the site I'm currently working on.

    Does anyone have any idea of how this is achieved? Thanks in advance!

  7. #7
    Join Date
    Oct 2013
    Location
    Sheboygan, Wisconsin
    Posts
    1,427
    Open the site then do a Ctrl+U and read the source.

  8. #8
    Join Date
    Mar 2017
    Posts
    19
    Quote Originally Posted by anoel06 View Post
    Ahh, I see. So I can create the form with html, but link the form with some .php coding to get it to function.
    Indeed. For php you would use the $_POST array to find the information, or documents that were send with the form. There should be plenty of code snippets that show this basic functionality

    Quote Originally Posted by anoel06 View Post
    And there wouldn't be any file size limitations unless I set them correct?
    For php i'm pretty sure there are might be some limitations that are set on your server. In most cases these can be increased with coding, htaccess or editting the php.ini file

    Quote Originally Posted by anoel06 View Post
    Also, is there any way possible I can do this without having the user register?
    Anyone that can click your form's submit button can send you a file. But either it's a registered user or not you should be careful: malicious files could be uploaded as well. Therefor you should always control the user input. One way would be to only allow certain types of documents (.pdf?) and check if this type of file is send. This should be implemented with other control mechanisms.

    If an user doesn't have to be registered to use your form, it is extra important to add some safety againsts bots (captcha, riddles, 'honeypots', ...)

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



Recent Articles