Upload Script Help :s

windows

Guest
Hi everybody, i want to make an uploading feature in my website except i dnt understand how to get this scrip to work, and which pages i need each script to go on, do i need cgi or somthing help me please any suggestions are welcome :D:D<br />
<br />
b.t.w. I found this script on javascript.internet.com,http://javascript.internet.com/forms/upload-filter.html<br />
the script is<br />
<br />
<br />
<HEAD><br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<!-- Original: ArjoGod, Shauna Merritt --><br />
<!-- Modified By: Ronnie T. Moore, Editor --><br />
<br />
<!-- This script and many more are available free online at --><br />
<!-- The JavaScript Source!! <!-- m --><a class="postlink" href="http://javascript.internet.com">http://javascript.internet.com</a><!-- m --> --><br />
<br />
<!-- Begin<br />
extArray = new Array(".gif", ".jpg", ".png");<br />
function LimitAttach(form, file) {<br />
allowSubmit = false;<br />
if (!file) return;<br />
while (file.indexOf("\\") != -1)<br />
file = file.slice(file.indexOf("\\") + 1);<br />
ext = file.slice(file.indexOf(".")).toLowerCase();<br />
for (var i = 0; i < extArray.length; i++) {<br />
if (extArray == ext) { allowSubmit = true; break; }<br />
}<br />
if (allowSubmit) form.submit();<br />
else<br />
alert("Please only upload files that end in types: " <br />
+ (extArray.join(" ")) + "\nPlease select a new "<br />
+ "file to upload and submit again.");<br />
}<br />
// End --><br />
</script><br />
</HEAD><br />
<br />
<!-- STEP TWO: Copy this code into the BODY of your HTML document --><br />
<br />
<BODY><br />
<br />
<center><br />
Please upload only images that end in: <br />
<script><br />
document.write(extArray.join(" "));<br />
</script><br />
<p><br />
<br />
<form method=post name=upform action="/cgi-bin/some-script.cgi" enctype="multipart/form-data"><br />
<input type=file name=uploadfile><br />
<p><br />
<input type=button name="Submit" value="Submit" onclick="LimitAttach(this.form, this.form.uploadfile.value)"><br />
</form><br />
</center><!--content-->Why have you posted on the same subject THREE TIMES?<br />
<br />
The reality is, JavaScript cannot achieve something like this. JS is a client-side scripting language, meaning that it does not have exclusive access to the server, thus, making file uploads impossible.<br />
<br />
Even the preceding example you got from javascript.internet.com points towards a CGI script which will upload the desired files.<br />
<br />
Dynamic file uploads are relient on server-side languages. So you will need to have a look at PHP, ASP, CGI, JSP, etc, etc.<br />
<br />
Regards,<br />
Andrew Buntine.<!--content-->
 
Back
Top