Closed coxw closed 9 years ago
Oh, sorry for the messy readme. Because I originally published this package mainly for myself. So I'll try to improve it in the future. Thanks for a helpful advice.:)
Can you also Upload a test complete project so any one can understand how its work. doc is not easy no understand. thanks
Hi, mamunhq. Thank you for your comment. I added a folder named "example" and the folder has controller, view and route. I hope the files will help you.:)
Thanks :)
@SUKOHI i need one more information line when i want to save this multiple image to database with outhers form value how can i save?
Hi, mamunhq. You mean you'd like to save other data related to an image at the same time when saving the image? If so, this package is not supposed to do it.(I might add the function in future, though)
However, you can save the form data when submitting like the below.
(in a controller action to submit data)
$surpass = Surpass::path($this->_surpass_test_path)->dir($this->_surpass_test_dir); $image_file_ids = Surpass::imageFileIds('dir_name'); // If you use example files, you should set "surpass_test".
foreach($image_file_ids as $image_file_id) { // $image_file_id refers to ID of DB table called image_files.
$surpass->saveAttributes($image_file_id, array(
'key_1' => 'value_1',
'key_2' => 'value_2',
'key_3' => 'value_3'
));
}
*Note: I haven't tested it yet, sorry.
or
It's not a stylish way but you might save them by adding the form values to TUSurpassTest.formData in JavaScript.("TUSurpassTest" might be different from yours. It depends on the directory name you'd like to save) Because "formData: {}" will be sent with an uploading image. I hope this can help you.:)
Actualy i have a from where i need to atatch multiple images.
i am trying to use https://blueimp.github.io/jQuery-File-Upload/ this is my view but when i submit the form its shoe null valu why ? array(7) { ["_token"]=> string(40) "jBhSOk5pKt9DPvglv6MJqWr2nbjR1YgdJeDJ4Ctt" ["title"]=> string(0) "" ["description"]=> string(0) "" ["price_30_min"]=> string(0) "" ["price_60_min"]=> string(0) "" ["price_90_min"]=> string(0) "" ["files"]=> array(1) { [0]=> NULL } }
I already upload image( its save the files)before submit this form.
Hi, mamunhq.
I think jQuery-File-Upload can only upload images. So you might need to set image data into input-hidden-tag or something through Ajax callback as soon as images will be uploaded like the following.
$('#id_name').fileupload({ dataType: 'json', done: function (e, data) {
// Set or generate hidden-tag using "e" or "data".
}
}); Thank you!
Would you be able to take some screenshots and put them in the readme? It's hard to know what the anticipated output is on this. For example, it doesn't look like you support the strongest feature of this JS plugin, https://blueimp.github.io/jQuery-File-Upload/. Checkout the Basic Plus UI view.