Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6174943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:50:16+00:00 2026-05-23T23:50:16+00:00

I’m looking for a very easy way to allow users to upload files (html)

  • 0

I’m looking for a very easy way to allow users to upload files (html) to my site. I’ve tried things like plupload and uploadify and they seem to difficult to implement/buggy. Are there any simple solutions out there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:50:17+00:00Added an answer on May 23, 2026 at 11:50 pm

    I actually just worked on this issue recently. Ill let you use my code i wrote. What it does is as soon as a user browses for one file, another upload box pops up and so on and so on. And then, i use phpmailer to send the files as email attachments. Look up phpmailer for more details…

    The javascript to add more upload fields.. (put in HEAD)

    <script type="text/javascript">   
    function addElement()
            {
                var ni = document.getElementById('org_div1');
                var numi = document.getElementById('theValue');
                var num = (document.getElementById('theValue').value -1)+ 2;
                numi.value = num;
                var newDiv = document.createElement('div');
                var divIdName = num;  newDiv.setAttribute('id',divIdName);
    
                newDiv.innerHTML = '<input type="file"  class="fileupload" size="80" name="file' + (num) + '" onchange="addElement()"/> <a class="removelink" onclick=\'removeElement(' + divIdName + ')\'>Remove This File</a>';
    
                // add the newly created element and it's content into the DOM
                ni.appendChild(newDiv);
            }
    
            function removeElement(divNum)
            {
                var d = document.getElementById('org_div1');
                var olddiv = document.getElementById(divNum);
    
                d.removeChild(olddiv);
            }
    
        </script>
    

    The HTML..

    <div id="org_div1" class="file_wrapper_input">
    
                            <input type="hidden" value="1" id="theValue" />
    <input type="file" class="fileupload" name="file1" size=
    "80" onchange="addElement()" /></div>
    

    The process.php page. NOTE: MUST EDIT!!! Search phpmailer and download their class.phpmailer.css class. Edit the configs in the file. Create and “uploads” directory.

    <?php
    require("css/class.phpmailer.php");
    
    
    
    
    
    //Variables Declaration
    $name = "Purchase Form";
    $email_subject = "New Purchase Ticket";
    
    $body = "geg";
    
    foreach ($_REQUEST as $field_name => $value){
    if (!empty($value)) $body .= "$field_name = $value\n\r";
    }
    $Email_to = "blank@blank.com"; // the one that recieves the email
    $email_from = "No reply!";
    //
    //==== PHP Mailer With Attachment Func ====\\
    //
    //
    //
    $mail = new PHPMailer();
    
    $mail->IsQmail();// send via SMTP MUST EDIT!!!!!
    $mail->From = $email_from;
    $mail->FromName = $name;
    $mail->AddAddress($Email_to);
    $mail->AddReplyTo($email_from);
    
    foreach($_FILES as $key => $file){
    $target_path = "uploads/";
    $target_path = $target_path .basename($file['name']);
    
    if(move_uploaded_file($file['tmp_name'], $target_path)) {
    echo "the file ".basename($file['name'])." has been uploaded";
    }else {
     echo "there was an error";
    }
    $mail->AddAttachment($target_path);
    }
    $mail->Body = $body;
    $mail->IsHTML(false);
    $mail->Subject = $email_subject;
    if(!$mail->Send())
    {  echo "didnt work";
    }
    else {echo "Message has been sent";}
    
    
    foreach($_FILES as $key => $file){
    $target_path = "uploads/";
    $target_path = $target_path .basename($file['name']);
    unlink($target_path);}
    }
    
    
    
    
    
    
    
    
    
    
    ?>
    

    Let me know if you have any questions!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I have a jquery bug and I've been looking for hours now, I can't
I would like to count the length of a string with PHP. The string
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.