SUKOHI / Surpass

A PHP package mainly developed for Laravel to manage uploading images using Ajax and displaying thumbnail.
29 stars 8 forks source link

Demo Screenshots #4

Closed coxw closed 9 years ago

coxw commented 9 years ago

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.

SUKOHI commented 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.:)

mamunhq commented 9 years ago

Can you also Upload a test complete project so any one can understand how its work. doc is not easy no understand. thanks

SUKOHI commented 9 years ago

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.:)

mamunhq commented 9 years ago

Thanks :)

mamunhq commented 9 years ago

@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?

SUKOHI commented 9 years ago

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.:)

mamunhq commented 9 years ago

Actualy i have a from where i need to atatch multiple images.

screenshot from 2015-04-05 03 47 09

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 } }

mamunhq commented 9 years ago

I already upload image( its save the files)before submit this form.

SUKOHI commented 9 years ago

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!