Yii Framework Forum: Xupload And File Type Problem - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Xupload And File Type Problem Rate Topic: -----

#1 User is offline   xNicox 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 19-October 10

  Posted 15 March 2013 - 07:41 AM

Hi, I have a problem with this extension.

I want to add acceptFileTypes option to the fileupdaload jQuery function, witch is wrapped in teh eextension xUpload.

the problem is that the acceptFileTypes option expect a regurar expresion.

Quote


acceptFileTypes

The regular expression for allowed file types, matches against either file type or file name as only browsers with support for the File API report the file type.

Type: Regular Expression
Example: /(\.|\/)(gif|jpe?g|png)$/i


and the extension uses the function CJavaScript::enconde() to enconde an aaray of options.

but the function return:
.fileupload({'url':'/index.php?r=cuota/uploadArchivoPagos','autoUpload':false,'maxNumberOfFiles':1,'acceptFileTypes':'/(\.|\/)(txt|dat)$/i)'};


and I need :
'acceptFileTypes':/(\.|\/)(txt|dat)$/i)

without the quotes...

Any idea?
Best Regards
Lic. Nicolas Machado
0

#2 User is offline   acorncom 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 100
  • Joined: 25-February 11
  • Location:CO, USA

Posted 19 March 2013 - 12:44 AM

Submit a pull request on Github and either Asgaroth or I can merge your changes in.
0

#3 User is offline   menxaca 

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

Posted 19 March 2013 - 06:42 AM

Try like this:

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


Saludos!
0

Share this topic:


Page 1 of 1
  • 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