用户登录时。然后选择图像。它成功上传了图像。但是,当新用户登录并选择图像时,该用户将被强制注销。我一直在网上浏览此问题,但找不到正确的答案。我已经使用localStorage进行登录,并在注销时删除了localStorage项。
<form id="upload_form" enctype="multipart/form-data">
<div class="row">
<div class="file-field input-field container col-s12">
<div class="form-group group">
<div class="btn">
<span><i class="fa fa-camera"></i> Upload Image</span>
<input type="file" name="file" accept='image/*'>
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" name="file" accept='image/*'>
</div>
</div>
</div>
</div>
var form = $(this);
var form_data = new FormData(form[0]);
$.ajax({
type: "POST",
url: upload.php,
data: form_data ? form_data : form.serialize(),
cache: false,
contentType: false,
processData: false,
success: function(data) {
}