Created
November 12, 2012 17:47
-
-
Save 0xPr0xy/4060814 to your computer and use it in GitHub Desktop.
with hack to prevent the fakepath :D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <style> | |
| #file{ | |
| display:none; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div id="file"><img src="http://www.geeksquad.nl/client/geeksquad/images/geek-squad-logo.png"/></div> | |
| <form enctype='multipart/form-data' action='fileupload.php' method='post'> | |
| <input type="file" name="file"></input> | |
| <input type='submit' value='Upload'></input> | |
| </form> | |
| <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> | |
| <script type="text/javascript"> | |
| var wrapper = $('<div/>').css({height:0,width:0,'overflow':'hidden'}); | |
| var fileInput = $(':file').wrap(wrapper); | |
| fileInput.change(function(){ | |
| $this = $(this); | |
| $hackedvalue = $this.val().replace('fakepath',''); | |
| $('#file').text($hackedvalue); | |
| }) | |
| $('#file').click(function(){ | |
| fileInput.click(); | |
| }).show(); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment