Forums

This topic is locked

Pure ASP Upload - Multiple Files - Require Upload

Posted 29 Jun 2003 10:40:13
1
has voted
29 Jun 2003 10:40:13 Les Wilkinson posted:
If I have more than one file in a form is it possible to set "Require Upload" on for the first file but off for the remaining files. I would like the form user to have to include at least one file and it seems that at the moment all are either on or off. If this is not possible in the extension is it possible directly in the ASP code?

Replies

Replied 30 Jun 2003 11:55:27
30 Jun 2003 11:55:27 Patrick Woldberg replied:
The Require Upload is done by javascript, so you should edit the javascript for this.

--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 10 Oct 2003 21:51:45
10 Oct 2003 21:51:45 Ken Schiff replied:
If someone asks a question like that, it's a sure bet that they don't know which JavaScript statement or how to do it. Could you provide some sample code? I would also suggest that this information be added to the help files that come with the product.

I did some checking of the code (I can read but not write code) and found two functions in the incPureUpload.js file that have a RequireUpload parameter: function checkFileUpload and function checkOneFileUpload. I went to my test page and changed the values of TRUE to false, but could only get all or none of the file fields to be validated. What the previous poster and I both want is for the first file field to be required, but any subsequent file fields should be optional.

So, I can't figure out the code. Can someone help?

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
The Require Upload is done by javascript, so you should edit the javascript for this.

--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

Edited by - guiguy on 10 Oct 2003 22:19:54
Replied 13 Oct 2003 22:29:01
13 Oct 2003 22:29:01 George Petrov replied:
I'm sorry but we do not support any user modifications of existing code. So this might be indeed possible but t isn't supported by Pure ASP Upload.

So any modification you make to the standard code are your own responsibility. We can not support or provide any code of how this can be done - since we just don't support it.

Also please in the future - post any Pure ASP Upload questions to the special dedicated support forum available under SUPPORT link at www.dmxzone.com/go?1622

There you should get the fastest support responses. Here in the general forums only general topics are discussed.

Greetings,
George

--------------------------------------------------
George Petrov - Founder of the Dynamic Zones
DMXzone.com, FWzone.net, FLzone.net, CFzone.net,
DNzone.com, FlashFreaks.nl
--------------------------------------------------
Replied 14 Oct 2003 09:32:42
14 Oct 2003 09:32:42 Patrick Woldberg replied:
Find in the incPureUpload.js the function checkOneFileUpload()

Search for the next part:
<pre id=code><font face=courier size=2 id=code>if (fileName == '') {
if (requireUpload) {
alert('File is required!');
field.focus();
return;
} else {
field.uploadOK = true;
}
} else {</font id=code></pre id=code>

Change it in:
<pre id=code><font face=courier size=2 id=code>re = new RegExp("\(file1|file3)$","i";
if (fileName == '') {
if (requireUpload & re.test(field.name)) {
alert('File is required!');
field.focus();
return;
} else {
field.uploadOK = true;
}
} else {</font id=code></pre id=code>

Turn on Require Filename, replace (file1|file3) with the name of the filefields that are required.

--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 17 Oct 2003 04:56:00
17 Oct 2003 04:56:00 Ken Schiff replied:
Thanks.

I suggest that you place the links to the support forum at the top of the page and make them more obvious.

Also, for the wish list: allow the person using PAU to indicate whether they want all the files (on multiple file upload fields) to be required, or just the first one.

Thanks.

Reply to this topic