473,788 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Copy File Field Value to Dynamic File Field Value

Firefox showed me a security error when I was copying a value of file
field object into new DOM created input file field. Can I do something
about it?
Thanks.

Nov 7 '07
19 6073
On Nov 7, 5:44 pm, s0lnic <l...@my.sigwro te:
VUNETdotUS wrote:
I need it to upload the files without refreshing the page. So, my new
hidden,
dynamically created DOM
form is submitting file value to iframe and user keeps on working with
current
visible form.

Oh, so submit the form and dynamically create a new one...user won't see
anything, don't worry. This method works on every major browser.

--
# Regards || piotr[.]solnica[at]gmail[.]com || jid : s0l...@jabster. pl #
# s0lnic ||http://blog.solnic.in5.pl || icq : 385935391 #
do you mean I have to submit the original for and then repaint it
plugging all values in? I do not know really...

Nov 7 '07 #11
On Nov 7, 10:47 pm, VUNETdotUS <vunet...@gmail .comwrote:
On Nov 7, 3:40 pm, VUNETdotUS <vunet...@gmail .comwrote:
On Nov 7, 3:28 pm, Darko <darko.maksimo. ..@gmail.comwro te:
s0lnic. cloneNode seems to be not browser compatible, doesn't it? I'll
try to test now...
Thanks.

Obviously, IE doe snot support. Is anyone familiar with cross browser
idea for cloning?
Try it harder. Maybe s0lnic made a syntax error, or forgot to put an
argument, but cloneNode
indeed *does* work in IE, which I have proofs for:
* I use it a lot and have tested it on IE, 6 and 7
* I used it with exactly the same purpose as yours, for sending a
file to server, in a hidden form inside
an iframe, by cloning the visible input type=file into the form and
then calling submit() on form.
Search the Internet for references of cloneNode usage, and try to
debug the script reading through
error messages. As for cloneNode, once it works in Mozilla, it will
work in IE. I guarantee.

Cheers.

Nov 8 '07 #12
Darko said the following on 11/7/2007 3:28 PM:
On Nov 7, 9:00 pm, VUNETdotUS <vunet...@gmail .comwrote:
<snip>
>that could be one of the solutions, but if I keep one form, can I
clone the file object, perhaps? Or, is it the only solution to break
the form?
Thanks

Randy Webb used to write some good posts in the past, but with all due
respect breaking the page into iframes sound horrible. As for the
question, if the topic starter only read what he head been told, he
would have noticed that s0lnic gave him the solution above, with code
and everything. And it works.
Did you test it in the most predominant browser on the web? Internet
Explorer creates a second file input but doesn't set the value property
of that file input. Not real "safe" on the WWW, do you think?
It is no security issue whatsoever, since you only clone what the
client had already filled in, so I don't see a reason for panic.
Reason 1: It relies on a flaw in Opera and Mozilla.
Reason 2: It doesn't "work" in the most predominant browser on the web.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 8 '07 #13
Darko said the following on 11/7/2007 6:56 PM:
On Nov 7, 10:47 pm, VUNETdotUS <vunet...@gmail .comwrote:
>On Nov 7, 3:40 pm, VUNETdotUS <vunet...@gmail .comwrote:
>>On Nov 7, 3:28 pm, Darko <darko.maksimo. ..@gmail.comwro te:
s0lnic. cloneNode seems to be not browser compatible, doesn't it? I'll
try to test now...
Thanks.
Obviously, IE doe snot support. Is anyone familiar with cross browser
idea for cloning?

Try it harder.
You can try it all you want to and IE still isn't going to set the
..value property of the file input.
Maybe s0lnic made a syntax error, or forgot to put an argument,
but cloneNode indeed *does* work in IE, which I have proofs for:
Nobody said cloneNodes doesn't work in IE. It will *not* set the value
of the input though.
* I use it a lot and have tested it on IE, 6 and 7
Did you test it with a file input that has a value chosen by the user?
Make a test file with an input type="file", use the browser button and
choose a file.
Use cloneNode to clone the input.

Tell us all what the value of that input is. It will be empty.
* I used it with exactly the same purpose as yours, for sending a
file to server, in a hidden form inside an iframe, by cloning the
visible input type=file into the form and then calling submit() on form.
Code that does it in IE?
Search the Internet for references of cloneNode usage, and try to
debug the script reading through error messages. As for cloneNode,
once it works in Mozilla, it will work in IE. I guarantee.
That I want to see.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 8 '07 #14
On Nov 8, 1:50 am, Randy Webb <HikksNotAtH... @aol.comwrote:
Darko said the following on 11/7/2007 6:56 PM:
On Nov 7, 10:47 pm, VUNETdotUS <vunet...@gmail .comwrote:
On Nov 7, 3:40 pm, VUNETdotUS <vunet...@gmail .comwrote:
>On Nov 7, 3:28 pm, Darko <darko.maksimo. ..@gmail.comwro te:
s0lnic. cloneNode seems to be not browser compatible, doesn't it? I'll
try to test now...
Thanks.
Obviously, IE doe snot support. Is anyone familiar with cross browser
idea for cloning?
Try it harder.

You can try it all you want to and IE still isn't going to set the
.value property of the file input.
Maybe s0lnic made a syntax error, or forgot to put an argument,
but cloneNode indeed *does* work in IE, which I have proofs for:

Nobody said cloneNodes doesn't work in IE. It will *not* set the value
of the input though.
* I use it a lot and have tested it on IE, 6 and 7

Did you test it with a file input that has a value chosen by the user?
Make a test file with an input type="file", use the browser button and
choose a file.
Use cloneNode to clone the input.

Tell us all what the value of that input is. It will be empty.
* I used it with exactly the same purpose as yours, for sending a
file to server, in a hidden form inside an iframe, by cloning the
visible input type=file into the form and then calling submit() on form.

Code that does it in IE?
Search the Internet for references of cloneNode usage, and try to
debug the script reading through error messages. As for cloneNode,
once it works in Mozilla, it will work in IE. I guarantee.

That I want to see.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptT oolbox.com/bestpractices/
You were right. I must have confused it with something else I've
tested with IE :)
All disregards accepted in advance. Sorry.

Still, I think it is not any security issue, and I stand behind that.
If the user
chose a file in the input field, why would he care if I just let
another field do it.
If the answer is "we might trick him", than we might trick him with a
single field as well.
To conclude, if a user agrees to send a file to the server, then it
doesn't matter if I send
it using another form, the way I see it. From that aspect, it's only a
bug in IE, not Mozilla.
The way I see it.

Darko

Nov 8 '07 #15
SAM
Darko a écrit :
As for cloneNode, once it works in Mozilla, it will
work in IE. I guarantee.
Hu ?

http://stephane.moriaux.pagesperso-o...nerHTML_danger
with tests for innerHTML and cloneNode
to try with IE *and* compliant browsers

results are a little different ... !

--
sm
Nov 8 '07 #16
On Nov 8, 1:36 pm, SAM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
Darko a écrit :
As for cloneNode, once it works in Mozilla, it will
work in IE. I guarantee.

Hu ?

http://stephane.moriaux.pagesperso-o...nerHTML_danger
with tests for innerHTML and cloneNode
to try with IE *and* compliant browsers

results are a little different ... !

--
sm
Look at my last post. I admitted Randy Webb was right about not being
able to successfully
clone the file input. Your quoting my "I guarantee" section doesn't
make me feel good
about my self :)

But, cloning itself indeed does work with Internet Explorer, it just
doesn't copy the object's
value, too, as Webb already said, when input type=file is object of
cloning.
The cloning itself, however, works and the link you've provided should
work in IE.

Nov 8 '07 #17
SAM
Darko a écrit :
On Nov 8, 1:36 pm, SAM <stephanemoriau x.NoAd...@wanad oo.fr.invalid>
wrote:
>>
http://stephane.moriaux.pagesperso-o...nerHTML_danger
with tests for innerHTML and cloneNode
to try with IE *and* compliant browsers

results are a little different ... !
Your quoting my "I guarantee" section doesn't
make me feel good about my self :)
Ha! bon! OK ;-)
But, cloning itself indeed does work with Internet Explorer, it just
doesn't copy the object's
value, too, as Webb already said, when input type=file is object of
cloning.
I didn't try with a filed file input.
(in Firefox for instance)
Usually when I clone a node, this node is a referent hidden one and if
it is a form's field it's empty. This way no problem with IE.
The cloning itself, however, works and the link you've provided should
work in IE.
Ho! Yes, IE can clone a node, but ...
.... with certain limits we have to know.

That just was the object of my post.

--
sm

Nov 8 '07 #18
VUNETdotUS wrote:
do you mean I have to submit the original for and then repaint it
plugging all values in? I do not know really...
In case you have other fields in that form, not only file inputs, then
submitting the original form doesn't make any sense of course. Your
solution with appending file inputs to a new form is far better then what
I've suggested.

--
# Regards || piotr[.]solnica[at]gmail[.]com || jid : s0****@jabster. pl #
# s0lnic || http://blog.solnic.in5.pl || icq : 385935391 #
Nov 8 '07 #19
Darko wrote:
[...] Thomas 'PointedEars' Lahn [...] wrote:
>s0lnic wrote:
>>VUNETdotUS wrote:
I need it to upload the files without refreshing the page. So, my new
hidden, dynamically created DOM form is submitting file value to iframe
and user keeps on working with current visible form.
Oh, so submit the form and dynamically create a new one...user won't see
anything, don't worry. This method works on every major browser.
Unless, of course, for some reason either client-side script support or
sufficient DOM support is not available.

Bad idea.
[...]

Unless he's got lynx :)
This is by far not the only one possibility for that.

Please trim your quotes, see
http://www.jibbering.com/faq/faq_notes/clj_posts.html
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8************ *******@news.de mon.co.uk>
Nov 10 '07 #20

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

Similar topics

3
5912
by: Tim Pollard | last post by:
Hi I'm not much of a javascripter, so I don't know whether this is possible, but...... I have a pop-up window in my asp web app which lets the user select a record from table1 from an alphabetical list - you know, the A | B | C | D filter thang. At the moment they have to cut and paste the appropriate recordID into
2
2387
by: Marc Elser | last post by:
Hi, I have a html form which is created by a cgi-script which sometimes opens a popup window. This popup window reads it's content from a hidden field in the openers form and writes it through document.write. The content of this popup itself can also be small forms for example a couple of radio button or textfields or things like that and every popup has it's own "save" button, When the user clicks "save" I have to read all the form...
1
1968
by: Simon Gare | last post by:
Hi I need to compare a dynamic field in an asp page to a field in another table, if there is no match then i would like to chane the row colour ( see code below). The problem Im having is that the comparison should be one of many entries in that db field, at the moment it only compares the first field in the db. Please Help
2
3466
by: Robert Fitzpatrick | last post by:
Does COPY require values for each column even though the database field is not set to NOT NULL? I did a COPY TO first to line up the data and then COPY FROM a tab delimited file. Here are the first 5 fields in the first line of the incoming file (omit the quotes, I put them there to see where the start and end of the line is), you should find 3 tabs after the second '1': '1 1 ' I have a table with this structure below and when...
2
7651
by: hotflash | last post by:
Hi All, I found the best pure ASP code to upload a file to either server and/or MS Access Database. It works fine for me however, there is one thing that I don't like and have tried to fix but don't have any luck is to do a form validation. This script requires the files: db-file-to-disk.asp and _upload.asp. There is a DESCRIPTION field in the db-file-to-disk.asp file, what I want to do is the user has to field out this fied before...
2
2917
by: hotflash | last post by:
Hi Master CroCrew, I found a good PURE ASP that will allow you to upload 10MB file to the server and the file contents such as Network, Author, Title, etc... will insert to MS Access at the same time. Below is a working script that I used. Let's say after the file is uploaded to the server and a record created with the file contents above to the MS Access (using the script below). If I want to UPDATE that record let's say, change the...
15
5278
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
4
4891
by: Michael Munch | last post by:
Hi I want to read the value of af text-field, create dynamic, in a form. Se below a small test-site to do that (but readning fails): I use the function Test_Read for reading the value from the dynamic create text-field "txtName". I thanks...
1
19824
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up with a list of values as suggestions to the user. This feature is called auto completion. In case of Eclipse editor, you must have seen while writing java code, if the developers presses "Ctrl+Space" a dynamic list box come up with multiple...
0
9656
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
9498
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
10366
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...
0
10175
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10112
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
9969
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
8993
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...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4070
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

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.