Rev 410 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 410 | Rev 424 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | 28 | ||
29 | $.ajax({ |
29 | $.ajax({ |
30 | url:"ajax.php", |
30 | url:"ajax.php", |
31 | method:"POST", |
31 | method:"POST", |
32 | data: { |
32 | data: { |
- | 33 | csrf_token:csrf_token, |
|
33 | plugin:"1.3.6.1.4.1.37476.2.5.2.4.1.95", |
34 | plugin:"1.3.6.1.4.1.37476.2.5.2.4.1.95", |
34 | action:"deleteAttachment", |
35 | action:"deleteAttachment", |
35 | id:id, |
36 | id:id, |
36 | filename:file, |
37 | filename:file, |
37 | }, |
38 | }, |
Line 53... | Line 54... | ||
53 | 54 | ||
54 | function uploadAttachment(id, file) { |
55 | function uploadAttachment(id, file) { |
55 | var file_data = $('#fileAttachment').prop('files')[0]; |
56 | var file_data = $('#fileAttachment').prop('files')[0]; |
56 | 57 | ||
57 | var form_data = new FormData(); |
58 | var form_data = new FormData(); |
- | 59 | form_data.append('csrf_token', csrf_token); |
|
58 | form_data.append('userfile', file_data); |
60 | form_data.append('userfile', file_data); |
59 | form_data.append('plugin', "1.3.6.1.4.1.37476.2.5.2.4.1.95"); |
61 | form_data.append('plugin', "1.3.6.1.4.1.37476.2.5.2.4.1.95"); |
60 | form_data.append('action', "uploadAttachment"); |
62 | form_data.append('action', "uploadAttachment"); |
61 | form_data.append('id', id); |
63 | form_data.append('id', id); |
62 | 64 |