Modify the FileUpload.csp in simple_example to avoid CORS (#573)
This commit is contained in:
parent
4c9463eeb7
commit
3222c0df84
|
@ -8,7 +8,7 @@
|
||||||
//File uploading method
|
//File uploading method
|
||||||
function UpladFile() {
|
function UpladFile() {
|
||||||
var fileObj = document.getElementById("file").files[0]; // js get file object
|
var fileObj = document.getElementById("file").files[0]; // js get file object
|
||||||
var url = "http://localhost:8848" + "/api/attachment/upload";
|
var url = "/api/attachment/upload";
|
||||||
|
|
||||||
var form = new FormData(); // FormData object
|
var form = new FormData(); // FormData object
|
||||||
form.append("file", fileObj); // File object
|
form.append("file", fileObj); // File object
|
||||||
|
@ -84,4 +84,4 @@
|
||||||
<input type="button" onclick="UpladFile()" value="Upload" />
|
<input type="button" onclick="UpladFile()" value="Upload" />
|
||||||
<input type="button" onclick="cancleUploadFile()" value="Cancel" />
|
<input type="button" onclick="cancleUploadFile()" value="Cancel" />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue