HTML Form Attachments

Discussion in 'Programming' started by jskyjake2013, Jun 18, 2015.

  1. Is it possible to make a html form with 2 text variables and 1 upload file variable, and when the user submits the form it will create a new folder with there name they imputed and in the folder the file they attached with be there along with a text document with there name and email?
     
  2. #2 SeiRruf, Jun 18, 2015
    Last edited: Jun 19, 2015
  3. be very weary allowing file uploads on your server... Very easy way to get pwned if you do not know what you are doing.
     
    • Agree Agree x 3
  4. its not hard just dangerous. what are the attatchment types
     
  5. I've made something like that a while back on my internship,
    not knowing any PHP back then, I used this resource to create what I needed.

    I must say, like z1haze has said before, that it is VERY dangerous to allow uploads just like that.
    Make sure to make enough security checks, especially with file extensions.
     
  6. You could just Google this and have a billion results come up.
     
  7. and even then its not safe enough because file extensions can be faked as well as executing php code inside of a png image as well.. I tried developing a neat too that was basically a dropbox for my web clients without having to give them an ftp account.. It just was not work the risk
     
  8. yes, learn javascript and php if you don't know how to!
     
  9. Like .mov .mp4 .mp3 .wav and other video file times
     
  10. Thats not working for me

    CORRECTION: I made the upload.php name uploads.php

    And how would I make it redirect to a different page once the file is uploaded
     
    #11 jskyjake2013, Jun 22, 2015
    Last edited: Jun 22, 2015
  11. PHP:
    <?php header ( 'Location: http://yourwebsite.com/path/to/your_page.html' ); ?>
    Simply add that bit (adjusted to your needs) in the part of your code after it finishes validating and uploading the file, to redirect it there afterwords.
     
  12. After what line?

    And I dont like it how it goes to a different page can I make it so it pops up on the screen like in my ideas part if there is an error?
     
  13. You are very, very very inexperienced with code to be doing this stuff yourself, if you don't even know when your file uploader completes a file upload, etc. lol

    In PHP, the code
    PHP:
    echo "your message here";
    Sends a message to the users browser. Add that in your code where the file finishes being uploaded, or anywhere you desire (and change the message appropriately). I know not the structure of your code, though I can imagine if I did, I'd have a little fun with it. heh
     
  14. Can you please just send me an example I still cant get it to work

    And I am talking about like how you make it on the other on you helped me with how if you didnt fill out part of the form it would pop up with a message when you try to submit it
     
  15. Sorry, I spoon fed you once, and I wasn't so happy with the outcome.
    I suggest finding a "ready-made" file uploader online, or paying to have someone else do it for you.
     
  16. Lol he really did spoon feed you man. Hire a developer.
     
  17. Think called Google, USE It before we all die of new stupidity