Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-22-2012, 06:45 PM   #1
Baseband Member
 
Join Date: Feb 2012
Location: United States
Posts: 28
Default PHP Script for Uploading

So the script works but not perfectly like i want it,

I want a user to click "upload" select multiple files and then upload them to my server.....

Currently i am only seeing the very last file that is selected and so it seems even though the script shows the number of files select it does not upload all the files.

Here is my code

PHP Code:
<!--Capture and submit forum-->
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<input type="file" value="" name="upload[]" multiple>
<form method="post" action="verify.php">
        <?php
          
require_once('recaptchalib.php');
          
$publickey "KEY GOES HERE REMOVED BY USER";
          echo 
recaptcha_get_html($publickey);
        
?>
        <input type="submit" />
      </form>
<!--Capture and submit forum-->
__________________

jlcpcnc is offline   Reply With Quote
Old 02-24-2012, 09:24 AM   #2
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: PHP Script for Uploading

Hi,

Do you have some html to go with this to try. Also for a great upload tutorial have a look at TUTORIAL: Upload Files To Database.
__________________

__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 02-24-2012, 02:46 PM   #3
Baseband Member
 
Join Date: Feb 2012
Location: United States
Posts: 28
Default Re: PHP Script for Uploading

I fixed it!

Now my question is how do you make it secure so someone cant upload a virus of something?
jlcpcnc is offline   Reply With Quote
Old 02-24-2012, 06:37 PM   #4
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: PHP Script for Uploading

Well there are a lot of ways these days but the one that I see the most is captcha.
__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 02-25-2012, 08:08 AM   #5
j03
~~~~~~~~
 
Join Date: Jan 2005
Location: Wales
Posts: 5,556
Send a message via MSN to j03
Default Re: PHP Script for Uploading

Check out: How To Automatically Scan Uploaded Files For Viruses With php-clamavlib | HowtoForge - Linux Howtos and Tutorials

There is a PHP Library that allows you to scan uploaded files with ClamAV.

You could also limit the types of files that your users can upload. For instance, if you only want people to be able to share images, then there is no point in allowing exe's to be uploaded. You could go for a whitelist (only allow certain types of files), or a blacklist (dis-allow specific file types)...
j03 is offline   Reply With Quote
Old 02-25-2012, 09:09 AM   #6
Baseband Member
 
Join Date: Feb 2012
Location: United States
Posts: 28
Default Re: PHP Script for Uploading

I am afraid to pass along the website as I do not want to get flagged for advertising.

But even when I set the multiple tag option i can select multiple files but it only uploads the last file selected.

Also my captcha works perfectly.

BTW, I am running windows and wamp

What I would like is for antivirus to scan the file when the submit button is pressed so that before the file ever hits the server it is scanned.
jlcpcnc is offline   Reply With Quote
Old 02-29-2012, 11:43 AM   #7
Daemon Poster
 
wmorri's Avatar
 
Join Date: May 2007
Posts: 1,066
Send a message via AIM to wmorri
Default Re: PHP Script for Uploading

You can post your website, I don't think that you will be flagged for advertising, and if you do I can talk to one of the admins for you. Most of the time if they see it is needed for a thread then they will leave it alone.
__________________
LEARN BY DOING NOT BY FOLLOWING DIRECTIONS!
Linux Forever!

I thought you were a hispanic/african american? Who is the white guy in the pictures?
wmorri is offline   Reply With Quote
Old 02-29-2012, 11:53 AM   #8
Baseband Member
 
Join Date: Feb 2012
Location: United States
Posts: 28
Default Re: PHP Script for Uploading

J & L Custom PC, Upload Here!
jlcpcnc is offline   Reply With Quote
Old 05-02-2012, 02:24 PM   #9
Baseband Member
 
engrmudasir's Avatar
 
Join Date: Dec 2011
Location: Pakistan
Posts: 23
Default Re: PHP Script for Uploading

Dear you need to studu HTML and PHP forms and then read about Saving your data into MySQL. Do have a look at the Copy() function in PHP and know how to save your files.
engrmudasir is offline   Reply With Quote
Old 05-08-2012, 07:08 AM   #10
Beta Member
 
Join Date: May 2012
Location: uk
Posts: 4
Default Re: PHP Script for Uploading

hi, had a break in my home the other week. took all my nice bits i pad i pods mp4 player etc but my sony vaio tz was taken. getting old now but was great for what i used it for! what do i get to replace it these days?
many thanks in advace to any help i get!
__________________

mikeyman is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:27 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0