Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.post({
- url: 'upload.php', // point to server-side PHP script
- dataType: 'text', // what to expect back from the PHP script
- cache: false,
- contentType: false,
- processData: false,
- data: {action: 'enviar', form: form_data}, //quero passar assim, mais de um parametro, o form_data seria o file.
- type: 'post',
- success: function (response) {
- $('#msg').html(response); // display success response from the PHP script
- },
- error: function (response) {
- $('#msg').html(response); // display error response from the PHP script
- }
- });
- });
- });
- </script>
- </head>
- <body>
- <h1>Single File Upload Example using PHP</h1>
- <p id="msg"></p>
- <input type="file" id="file" name="file" />
- <button id="upload">Upload</button>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement