I have this extension up and running on a form with additional data + files.
So I’m submitting the form at the end after uploads (using ‘autoUpload’ => true).
I was wondering is there a way to disable the submit button and when (at least one of the) uploads are complete enable the submit button again? To prevent the user from submitting the form before the uploads are complete.
$this->widget('bootstrap.widgets.TbButton', array(
'buttonType' => 'submit',
'type' => 'primary',
'disabled' => false, //This is what i want to change from true->false when uploads are done
'label' => 'Submit',
));
I’ve tried to find a solution for some time now. If someone could point me to the right direction.
I would like however, to use it for uploading TXT files and to use data from the TXT files. is it possible somehow to fill form fields with uploaded file’s content? That would be awesome!
I guess you have to allow the .txt extension file when you call to xupload, once the file is uploaded you will need to open it and read the content, the format file in which you will find your fields depends of your design, all this is up to you.
if there is no defined file type, it should accept any kind of files, right? there is no definition anywhere as I see.
this is what I can find in XUploadForm.php:
public function rules() {
return array(
array('file', 'file'),
);
}
how can I check if the upload was successful? in fact, I don’t really need the file to be uploaded onto the hard drive, it’s fair enough for me to just temporarily upload it into memory, and extract it’s contents and persist into database. I would like to know at which step is the file available to use it. that’s what I don’t know yet. I wanted to try to print_r its contents, that’s when I got the error messages. can you please help me at which step is the file available to handle its contents?
strange, anyway upload seems good, but SAVE button is doing nothing.
I have tried this but maybe I was doing it wrong, I don’t know, isn’t is possible here to make a
print_r($model->file);
? I get “SyntaxError: Unexpected token” error. isn’t it an array? echo also give me “SyntaxError: Unexpected token” error.
you are right! but I still have no clue how to do it… I’m just struggleing.
thanks a lot
if I hit the submit or save button, nothing happens.
update! I have found some mistakes:
in chrome, firebug light doesn’t show error, in FF, FB show the error. the tmp folder was missing, that’s why there was no real upload! it began to save tmp files on my hard drive’s root…
now with print_r I see file contents in firebug (but why only in FB, why not on the page?), but it’s strange looking, and I get this error
I’m not sure if I really need this fancy ajax thing. now I could make it with the most simple way, and now it’s a good start for me.
and create an action like actionGetphotos as above url specified, the action collect the images data, and response json content as the download view expected.
Anyone has a Xupload version running the latest jQuery File Upload? I tried simply replacing the JS files found on the jQuery File Upload github but it doesn’t seem to work.
Is it possible to dispay already uploaded files when page loaded/reloaded, like in jQuery File Upload. If not, maybe you have some advice how to make it?