Because a general upload is required,
Therefore, you can directly upload a previously written file. Program Copy it,
I want to pass two parameters: input name and form name, and then the value will be automatically returned,
You can call this method directly in other projects,
After the results are written, the local test is normal, Code As follows:
< Form Name = "Myform" Action = "Myjsp" >
< Input Type = Text Name = "Pic" >
< IFRAME SRC = "Upload? Form = myform & inputname = pic" > </ IFRAME >
</ Form >
After processing the complete upload process, use
< Script > Parent.doc ument. form name. Input name. Value = 'Path Path' </ Script >
To automatically return the upload path to the input box,
Of course, there is nothing wrong with writing this way, and I have always used it like this,
But this time something went wrong,
I am normal on the local machine, and the value can be returned correctly,
However, when my colleagues use it on another computer, the problem arises,
Because the project is different, IFRAME must be included in the complete path,
That is to say,
< IFRAME SRC = "Http://www.xxx.com/UploadFile/Upload? Form = myform & inputname = pic" > </ IFRAME >
Ho, the problem arises. An error is prompted after the upload and access is denied,
Dizzy, how can I deny access? Hurry up, GG,
Cross-origin access is detected. Cross-origin access is disabled by IE by default,
It seems like this. The value cannot be returned. How can this problem be solved,
Find another method,
This is pretty cool, and you don't need any form names or the like. :)
The complete code after modification is as follows:
< Form Name = "Myform" Action = "Myjsp" >
< Input Type = Text ID = Text1 >
< IFRAME SRC = "Http://www.xxx.com/UploadFile/Upload" ID = T1 > </ IFRAME >
< Script For = T1 Event = Onload >
Text1.value = Window. status;
</ Script >
</ Form >
After the upload process is complete,
< Script > Window. Status = " Path: The uploaded path " ; </ Script >
This is more convenient than the initial method. :)