Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Expire headers
- header('Expires: Tue, 08 Oct 1991 00:00:00 GMT');
- header('Cache-Control: no-cache, must-revalidate');
- ?>
- <!doctype html>
- <!--[if lt IE 7 ]><html lang=en-us class="no-js ie6"><![endif]-->
- <!--[if IE 7 ]><html lang=en-us class="no-js ie7"><![endif]-->
- <!--[if IE 8 ]><html lang=en-us class="no-js ie8"><![endif]-->
- <!--[if (gte IE 9)|!(IE)]><!--> <html lang=en-us class=no-js> <!--<![endif]-->
- <head>
- <meta charset=utf-8>
- <meta http-equiv=X-UA-Compatible content="IE=Edge;chrome=1">
- <title>Test para el maldito upload form</title>
- <style>
- style{
- display: block;
- float: right;
- background: #444;
- }
- </style>
- </head>
- <body>
- <div style="float: left; margin-right: 100px;">
- <?php
- //Unique ID
- $uid = md5(uniqid(rand()));
- if ($_FILES){
- echo "<pre>";
- var_dump($_FILES);
- echo "</pre>";
- }
- ?>
- </div>
- <form action="" method="post" enctype="multipart/form-data" name="upload" id="upload">
- <?php
- echo "UID: ".$uid."<br>";
- ?>
- <input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="<?php echo $uid; ?>" />
- <input type="file" name="file" id="file" /> <br>
- <input type="submit" /><br>
- <iframe
- width="400px"
- height="400px"
- frameborder="1"
- src=""
- id="upload_frame"
- name="upload_frame"></iframe>
- </form>
- <pre><style contenteditable>
- body{
- background-color: #444;
- color: white;
- }
- form{
- border: 1px solid white;
- padding: 30px;
- float: left;
- }
- p.debug{
- background-color: yellow;
- color: black;
- }
- </style></pre>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.js" type="text/javascript"></script>
- <script>
- $("#upload").submit(function(){
- console.log("onSubmit event!");
- function set(){
- $("#upload_frame").attr("src", "/tmp/progress.php?uid=<?php echo $uid; ?>");
- }
- setTimeout(set);
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement