473,698 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript uploader

How do I make this script direct uploads to a folder called incoming.

<!-- TWO STEPS TO INSTALL UPLOAD FILTER:

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document
-->

<HEAD>

<SCRIPT LANGUAGE="JavaS cript">
<!-- Original: ArjoGod, Shauna Merritt -->
<!-- Modified By: Ronnie T. Moore, Editor -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
extArray = new Array(".gif", ".jpg", ".png");
function LimitAttach(for m, file) {
allowSubmit = false;
if (!file) return;
while (file.indexOf(" \\") != -1)
file = file.slice(file .indexOf("\\") + 1);
ext = file.slice(file .indexOf(".")). toLowerCase();
for (var i = 0; i < extArray.length ; i++) {
if (extArray[i] == ext) { allowSubmit = true; break; }
}
if (allowSubmit) form.submit();
else
alert("Please only upload files that end in types: "
+ (extArray.join( " ")) + "\nPlease select a new "
+ "file to upload and submit again.");
}
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<center>
Please upload only images that end in:
<script>
document.write( extArray.join(" "));
</script>
<p>

<form method=post name=upform action="/cgi-bin/some-script.cgi"
enctype="multip art/form-data">
<input type=file name=uploadfile >
<p>
<input type=button name="Submit" value="Submit"
onclick="LimitA ttach(this.form , this.form.uploa dfile.value)">
</form>
</center>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://javascriptsourc e.com">The JavaScript
Source</a></font>
</center><p>

<!-- Script Size: 1.55 KB -->
Jul 20 '05 #1
3 5542
On 6 Nov 2003 21:31:32 -0800, in comp.lang.javas cript
dv*****@yahoo.c om (dvdljns) wrote:
| How do I make this script direct uploads to a folder called incoming.


You can't because the script doesn't handle the actual file upload.
The upload process is handled by the 'some-script.cgi'.

Do a Google search on File Upload + <language of your choice>

[snip 2 end]
---------------------------------------------------------------
jn****@yourpant sbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 20 '05 #2
In article <96************ **************@ posting.google. com>, dv*****@yahoo.c om
(dvdljns) writes:
How do I make this script direct uploads to a folder called incoming. <snip><form method=post name=upform action="/cgi-bin/some-script.cgi"
enctype="multi part/form-data">


you edit the some-script.cgi file to put it in the incoming folder. javascript
has no ability to actually "upload" files. And the script you have is totally
useless, as far as uploading that file. Simply put a form on your page, set the
form, then validate it on the server (which you should be doing anyway). The
only purpose of the script you have *might* be to check the filetype before
uploading.
--
Randy
Jul 20 '05 #3


Ok thanks! Tell me do you know Where I can get the right stuff to upload
files.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1427
by: Andy | last post by:
Hi I have recently developed a few sites with an uploader facility for images and all has worked perfectly, until now??? I re-installed .NET due to an unrelated problem and since then if I use a WebServer Button control to submit the form I have nothing within the Html uploader component it's 'null'??
2
3950
by: bsprogs | last post by:
Alright, I'm very new to JavaScript but I'm fair with PHP. I'm working on an uploader script and what I'm trying to do is take the file name from the file input box. I looked at string manipulation in terms of using indexOf, substr, substring, etc... and I can't figure it out for the life of me! Here is what I'm trying to do: Example: I select the file: C:\Documents and Settings\BSPROGS\Desktop\DeVry\Previous work\BIS...
3
19874
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be found at www.srmiles.com/freestuff/ajax_file_uploader/ . you can do multiple file uploads. each upload will have it's own "form"-tag, so that each file is uploaded for its own. could be a good solution if there are "big" uploads.
2
1319
by: harikrishnan4u | last post by:
How can we check the image size in rad uploader this file uploader is in the rad editor??any one Know
9
4613
by: perhapscwk | last post by:
I download several .php file(uploader, etc) from internet and it works in ftp. however, it not work in "local host". WHy? is it because of the folder permission?i using apache...anything need to set there? how to set? thanks.
7
7152
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and Silverlight 2.0. To get these tools please visit this page Get Started : The Official Microsoft Silverlight Site and follow Step 1. Occasionally you find the need to have users upload multiple files at once. You could use multiple FileUpload...
6
2854
by: neovantage | last post by:
Hey all, i have installed Uber uploader on my server. and it is working perfectly. It shows progress bar after submitting form. I want that when i upload an image or a file it shows the progress in Popup fancy window like thickbox and Upload Page as well at behind the fancy screen untill unless the file uploading complete. here is the url Link where i install Uber Uploader latest version script. If some one guide me that how can i do that...
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.