more upload fixes
This commit is contained in:
parent
203684e4aa
commit
b5e1ca21c0
@ -38,8 +38,8 @@ function register_controlls(){
|
||||
//Your validation
|
||||
});
|
||||
|
||||
$('#btn_upload').click(function(){
|
||||
var formData = new FormData($('form')[0]);
|
||||
$('.btn_upload').click(function(){
|
||||
var formData = new FormData($('#form_'+$(this).attr('cat'))[0]);
|
||||
$.ajax({
|
||||
url: SAI_ENDPOINT+'sai_mod=.SYSTEM.SAI.saimod_sys_files&action=upload&cat='+$(this).attr('cat'), //Server script to process data
|
||||
type: 'POST',
|
||||
|
||||
@ -17,7 +17,8 @@ class saimod_sys_files extends \SYSTEM\SAI\SaiModule {
|
||||
}
|
||||
|
||||
public static function sai_mod__SYSTEM_SAI_saimod_sys_files_action_upload($cat){
|
||||
if(!\SYSTEM\FILES\files::put($cat, basename($_FILES['datei']['name']) , $_FILES['datei']['tmp_name'])){
|
||||
new \SYSTEM\LOG\WARNING(print_r($_FILES,true));
|
||||
if(!\SYSTEM\FILES\files::put($cat, basename($_FILES['datei_'.$cat]['name']) , $_FILES['datei_'.$cat]['tmp_name'])){
|
||||
throw new \SYSTEM\LOG\ERROR("upload problem");}
|
||||
|
||||
return \SYSTEM\LOG\JsonResult::ok();
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
${content}
|
||||
<tr>
|
||||
<br>
|
||||
<th><form enctype="multipart/form-data"><input type="file" name="datei"></th>
|
||||
<th><form enctype="multipart/form-data" id="form_${cat}"><input type="file" name="datei_${cat}"></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><input type="submit" class="btn" value="Upload" id="btn_upload" cat="${cat}"></form></th>
|
||||
<th><input type="submit" class="btn btn_upload btn-success" value="Upload" cat="${cat}"></form></th>
|
||||
</tr>
|
||||
</table>
|
||||
Loading…
x
Reference in New Issue
Block a user