Upload File without refreshing actual pg
-
Hi. I'm a beginner, so may be you'll find this question easy to answer. I'm trying to upload a file from a web page with an tag, and I want to submit it without refreshing the actual page. I'm working with two frames: the visible one and a hidden one (not visible) with which I've been trying to send the form included in the visible one with javascript/DOM, but when I get the name of the file to upload I can't clone the input object to the not visible frame and send the form from the hidden frame (I think this is due to the impossibility to copy the path of the input tag to the hidden frame). Could any one help me, please? I've been searching the web, but I found no example (may be because it's too obvious for someone with a minimum experience). Thanks in advance.
-
Hi. I'm a beginner, so may be you'll find this question easy to answer. I'm trying to upload a file from a web page with an tag, and I want to submit it without refreshing the actual page. I'm working with two frames: the visible one and a hidden one (not visible) with which I've been trying to send the form included in the visible one with javascript/DOM, but when I get the name of the file to upload I can't clone the input object to the not visible frame and send the form from the hidden frame (I think this is due to the impossibility to copy the path of the input tag to the hidden frame). Could any one help me, please? I've been searching the web, but I found no example (may be because it's too obvious for someone with a minimum experience). Thanks in advance.
There is one possibility I can think of to stop the page refreshing. When a request is made to a server a status code is returned whether it be 200 (OK) or 404 (Not Found) by default, otherwise the Internet would not work. There is however a status code which does not return which is 204. On the client side submit a page as normal. On the server side page do what you have to do with the the request and finally return a staus code of 204. The page will not move. He who laughs last thinks slowest.
-
There is one possibility I can think of to stop the page refreshing. When a request is made to a server a status code is returned whether it be 200 (OK) or 404 (Not Found) by default, otherwise the Internet would not work. There is however a status code which does not return which is 204. On the client side submit a page as normal. On the server side page do what you have to do with the the request and finally return a staus code of 204. The page will not move. He who laughs last thinks slowest.