/    Sign up×
Community /Pin to ProfileBookmark

uploading more then 1 file

is there a way withte current upload way “

[code=php]
<form enctype=”multipart/form-data” action=”_URL_” method=”POST”>
<input type=”hidden” name=”MAX_FILE_SIZE” value=”30000″>
Send this file: <input name=”userfile” type=”file”>
<input type=”submit” value=”Send File”>
</form>

[/code]

to upload more then 1 file at the same time?
thnaks in advance
peleg

to post a comment
PHP

15 Comments(s)

Copy linkTweet thisAlerts:
@JonaFeb 17.2005 — [font=trebuchet ms]It shouldn't be a problem, just add another INPUT TYPE=FILE field.[/font]
Copy linkTweet thisAlerts:
@pelegk1authorFeb 17.2005 — but that's means if i have 100 filees to upload

i need to write that line 100 times and select them all

i want to upload all of them at once
Copy linkTweet thisAlerts:
@FangFeb 17.2005 — You would probable be timed out or prevented from uploading such a large amount of data by the server.
Copy linkTweet thisAlerts:
@pelegk1authorFeb 17.2005 — sayy all th e files together weight 150k

there should be no problem from the server

so still is there a way to do it?

i ask this beacuse in this articel :

[URL=http://www.15seconds.com/issue/010522.htm]http://www.15seconds.com/issue/010522.htm[/URL]

you can do it in asp+an object
Copy linkTweet thisAlerts:
@96turnerriFeb 18.2005 — <i>
</i>&lt;form...........&gt;
&lt;?php
for($x = 1; $x &lt;= 100; $x++) {
echo "&lt;input name="userfile$x" type="file"&gt;";
}
?&gt;
&lt;/form&gt;


[code=php]
//php proccessor
<?php
$file_dir = $_SERVER['DOCUMENT_ROOT']."/path/to";
foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
$file_name = $file_array['name'];
if( is_uploaded_file( $file_array['tmp_name'] ) ) {
move_uploaded_file( $file_array['tmp_name'], "$file_dir/$file_name") or die ("Couldn't Copy");
}
}
?>
[/code]
Copy linkTweet thisAlerts:
@pelegk1authorFeb 18.2005 — the point is to upload an unkown number of files in advance

the 100 was just an example of big number of files

and dont forget that in your way the user must go over every file and select it to upload it
Copy linkTweet thisAlerts:
@FangFeb 18.2005 — I think you will have to do it with activeX or Java. Only Opera supports multiple file upload.
Copy linkTweet thisAlerts:
@bokehFeb 18.2005 — maybe you could have a simple form that says:

"How many files do you wish to upload"

The user would enter the number into a text box and submit it and then the php script would then build a form with the correct number of file upload boxes using the loop function.
Copy linkTweet thisAlerts:
@pelegk1authorFeb 18.2005 — beacuse in the link above there is example how its done in asp+some object

so i thought maybe in php its possible too?
Copy linkTweet thisAlerts:
@96turnerriFeb 19.2005 — [i]Originally posted by pelegk1 [/i]

[B]and dont forget that in your way the user must go over every file and select it to upload it [/B][/QUOTE]


and in the other version you dont have to select files you wish to upload? what do they do magically appear or something
Copy linkTweet thisAlerts:
@pelegk1authorFeb 19.2005 — in the other way you can tell it to upload all the folder!
Copy linkTweet thisAlerts:
@96turnerriFeb 20.2005 — why not just upload a zip file and get php to extract it on the server
Copy linkTweet thisAlerts:
@FangFeb 20.2005 — [i]Originally posted by pelegk1 [/i]

[B]because in the link above there is example how its done in asp[COLOR=red]+some object[/COLOR]

so i thought maybe in php its possible too? [/B]
[/QUOTE]


It's the client-side files system you have to interact with - ActiveX or similar
Copy linkTweet thisAlerts:
@pelegk1authorFeb 20.2005 — that execlly what's i nthe link
Copy linkTweet thisAlerts:
@96turnerriFeb 20.2005 — so why are you sying some object if you know how to do it? and any suggestion made you just say no thats not how THEY do it or similar

:rolleyes:
×

Success!

Help @pelegk1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...