Yii Framework Forum: [Extension] Xupload - Yii Framework Forum

Jump to content

  • (20 Pages)
  • +
  • « First
  • 15
  • 16
  • 17
  • 18
  • 19
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] Xupload Rate Topic: ***** 1 Votes

#321 User is offline   aabo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 25-March 13

Posted 25 March 2013 - 08:10 PM

Hi,

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.
Thanks in advance!
0

#322 User is offline   cappadochian 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 02-January 11

Posted 26 March 2013 - 04:34 PM

Hi!

awesome extension!
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!
Thanks a lot!

best regards,
c
0

#323 User is offline   cappadochian 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 02-January 11

Posted 27 March 2013 - 03:22 PM

can somebody point me to the right direction please, thanks.
0

#324 User is offline   menxaca 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 121
  • Joined: 26-November 12
  • Location:Talavera de la Reina, Spain

Posted 27 March 2013 - 04:20 PM

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.

Saludos.

View Postcappadochian, on 27 March 2013 - 03:22 PM, said:

can somebody point me to the right direction please, thanks.

0

#325 User is offline   cappadochian 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 02-January 11

Posted 28 March 2013 - 01:34 AM

thanks a lot!

but I can't find any relevant files with rules restricted only to upload image files. where can I find these rules?
I tried to print_r uploaded file, but I always get the error: "Invalid token T" or "Invalid token C" or "Invalid token X". What is this? Why is that?

many thanks
0

#326 User is offline   menxaca 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 121
  • Joined: 26-November 12
  • Location:Talavera de la Reina, Spain

Posted 28 March 2013 - 11:45 AM

with this option you can restrict to upload only image files, so you will have to change the image extensions to the extension you desire:

'acceptFileTypes' => "js:/(\.|\/)(jpe?g|png)$/i",


Check the documentation here

Saludos

View Postcappadochian, on 28 March 2013 - 01:34 AM, said:

thanks a lot!

but I can't find any relevant files with rules restricted only to upload image files. where can I find these rules?
I tried to print_r uploaded file, but I always get the error: "Invalid token T" or "Invalid token C" or "Invalid token X". What is this? Why is that?

many thanks

0

#327 User is offline   cappadochian 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 02-January 11

Posted 28 March 2013 - 01:05 PM

View Postmenxaca, on 28 March 2013 - 11:45 AM, said:

with this option you can restrict to upload only image files, so you will have to change the image extensions to the extension you desire:

'acceptFileTypes' => "js:/(\.|\/)(jpe?g|png)$/i",


Check the documentation here

Saludos


hi, thanks,

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.

thanks a lot!
0

#328 User is offline   menxaca 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 121
  • Joined: 26-November 12
  • Location:Talavera de la Reina, Spain

Posted 28 March 2013 - 02:13 PM

I'm not sure if when you get the instance you are able to open and read the content, try to open and read the content file after:
$model->file = CUploadedFile::getInstance( $model, 'file' );


If you get some error, I guess you will need to save it in harddisk firstly, open and read the content file and after that delete the existing file.

What did you mean "SAVE button is doing nothing"?



View Postcappadochian, on 28 March 2013 - 01:05 PM, said:

hi, thanks,

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.

thanks a lot!

0

#329 User is offline   cappadochian 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 02-January 11

Posted 28 March 2013 - 03:45 PM

View Postmenxaca, on 28 March 2013 - 02:13 PM, said:

I'm not sure if when you get the instance you are able to open and read the content, try to open and read the content file after:
$model->file = CUploadedFile::getInstance( $model, 'file' );

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.

View Postmenxaca, on 28 March 2013 - 02:13 PM, said:

If you get some error, I guess you will need to save it in harddisk firstly, open and read the content file and after that delete the existing file.
you are right! but I still have no clue how to do it... :( I'm just struggleing.

View Postmenxaca, on 28 March 2013 - 02:13 PM, said:

What did you mean "SAVE button is doing nothing"?


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

Quote

SyntaxError: JSON.parse: unexpected character


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.
0

#330 User is offline   Enrique Zafra 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 16-June 11

Posted 08 April 2013 - 04:56 PM

Hi!

awesome extension!
would be possible to get the number of files uploaded correctly to establish a minimum number of files to validate the form?
Thanks a lot!

best regards,
0

#331 User is offline   wainguo 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 13-January 13

Posted 09 April 2013 - 03:16 AM

View Postsiwen66, on 27 April 2012 - 07:48 PM, said:

Thank you for this nice ext.
I am newbie to Yii and this ext.
How can I auto-populating the Widget with the contents of a directory which user just uploaded?
Now I can upload/download files no problem at all. But after I refresh or open an new window, all files shows in the Widget are gone. The files are still in directory.

I can get all files name,type,size and directory which I want to show in Xupload.php. Just don't know how to show this to Download(widget) page.
Thank you for your help.

Regards,


another sol as the original example did:

just add this *js* to your view( the view where you add this *widget*)
<script type="text/javascript">
    $(function () {
        'use strict';

        // Initialize the jQuery File Upload widget:
        $('#XUploadForm-form').fileupload({
            url: 'getphotos/'
        });

        $.ajax({
            url: $('#XUploadForm-form').fileupload('option', 'url'),
            dataType: 'json',
            context: $('#XUploadForm-form')[0]
        }).done(function (result) {
            $(this).fileupload('option', 'done')
                    .call(this, null, {result: result});
        });
    });
</script>


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.

that's all.
0

#332 User is offline   menxaca 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 121
  • Joined: 26-November 12
  • Location:Talavera de la Reina, Spain

Posted 15 April 2013 - 06:57 AM

Anyone?

View Postmenxaca, on 16 March 2013 - 06:15 PM, said:

Hi...

Does someone know how to change the value of maxNumberOfFiles option in runtime?

Thanks!

0

#333 User is offline   gin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 14-October 12

Posted 21 April 2013 - 01:38 AM

View PostAsgaroth, on 09 May 2011 - 10:44 AM, said:

The extension is now up to date, any feedback is appreciated thanks.

The link:

http://www.yiiframew...ension/xupload/



Hi Asgaroth,

when uploaded the proportion height > width image , why the Preview images is transverse´╝č

please help ,thanks so much!
0

#334 User is offline   Ahmed Sharaf 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 07-April 13

Posted 02 May 2013 - 07:50 AM

Hello,
I need a list of all available callback functions ex:

$this->widget('xupload.XUpload', array(
'url' => Yii::app()->createUrl("form/upload", array("parent_id" => 1)),
'model' => $photos,//An instance of our model
'attribute' => 'file',
'multiple' => false,
'options' => array(//Additional javascript options
//I need all callbacks functions
'onComplete' => '', ...


),
));

Thank You.
0

#335 User is offline   yugene 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 513
  • Joined: 08-August 09

Posted 02 May 2013 - 09:54 AM

Xupload is based on jQuery File Upload plugin. You may find callbacks in the source or at the plugin docs.
0

#336 User is offline   simon604 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 19-April 13

Posted 06 May 2013 - 01:35 PM

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.
0

#337 User is offline   Ahmed Sharaf 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 07-April 13

Posted 07 May 2013 - 06:05 AM

Thank you very much "Yugene" :)
0

#338 User is offline   Tpona 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 08-May 13

Posted 27 May 2013 - 01:59 PM

Hi, Asgaroth!

First, thanks for the great plugin!

Second, my question:
If after upload files (but before save model data) i'll reload page, for example, by F5 button, all generated images preview, disappear.

I want display their again, after page refresh.
What to do in this case?

Thx for your answer!
0

#339 User is offline   wisper 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 05-June 13

Posted 05 June 2013 - 11:38 PM

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

#340 User is offline   wisper 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 05-June 13

Posted 05 June 2013 - 11:40 PM

View PostTpona, on 27 May 2013 - 01:59 PM, said:

Hi, Asgaroth!

First, thanks for the great plugin!

Second, my question:
If after upload files (but before save model data) i'll reload page, for example, by F5 button, all generated images preview, disappear.

I want display their again, after page refresh.
What to do in this case?

Thx for your answer!


Same question
0

Share this topic:


  • (20 Pages)
  • +
  • « First
  • 15
  • 16
  • 17
  • 18
  • 19
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users