Allowed extensions for File Uploads not working

Please post any ChronoForms bugs you found here

Allowed extensions for File Uploads not working

Postby Blade on Tue Dec 18, 2007 5:55 pm

Hi!

I'm trying to build a form with two file uploads, one field for .doc and .pdf, the other for a photo. However, my files don't get accepted and never make it to the server.

I put in "CV:doc|pdf,foto:jpg|gif|png" under File Uploads => Allowed Extensions and saved the form. However, when I go back to Edit the form again, Allowed Extensions now has the value "Arrray".

I'm using Joomla 1.5 RC3 and the latest ChronoForms.

I already set the PHP error reporting level to E_NOTICE so this isn't due to the bug where php warnings are generated due to some vars not being initialised before use.

Any help is appreciated
Blade
Fresh Boarder
 
Posts: 2
Joined: Tue Dec 18, 2007 10:41 am

Re:Allowed extensions for File Uploads not working

Postby GreyHead on Tue Dec 18, 2007 6:11 pm

Hi Blade,

That's weird, I don't recognise that problem at all. Please will you take a backup copy of the form (use the button in Forms Manager) and post it here or email it to me at the address in my sig.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3779
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Allowed extensions for File Uploads not working

Postby admin on Wed Dec 19, 2007 6:48 pm

Hi Blade,

Have you made any hacks to ChronoForms ? there is a bug with the 1.5 version in the file uploads section and yes files will never get uploaded without a hack, please search the forums for it, its here somewhere :)

Sincerely,

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4018
Joined: Mon Aug 14, 2006 5:29 am

Re:Allowed extensions for File Uploads not working

Postby GreyHead on Wed Dec 19, 2007 8:37 pm

Hi Blade & Max,

I've updated the 1.5 download version to RC1a which now includes this bugfix. I've also attached the amended chronocontact.php to this post.

Bob [file name=chronocontact-ffc23672acca804e7618e1c737eecd83.zip size=5028]http://www.chronoengine.com/components/com_fireboard/uploaded/files/chronocontact-ffc23672acca804e7618e1c737eecd83.zip[/file]<br><br>Post edited by: GreyHead, at: 2007/12/19 15:37
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3779
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Allowed extensions for File Uploads not working

Postby admin on Wed Dec 19, 2007 8:49 pm

Great, Thank you very much Bob!! :)

Sincerely,

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4018
Joined: Mon Aug 14, 2006 5:29 am

Re:Allowed extensions for File Uploads not working

Postby gg4j on Thu Dec 27, 2007 2:38 am

Ouch!


So I tryed the file, but no working.

I must say that CC under JRC1 works fine.

I wanna upgrade to RC4.

I copyed the same form running under RC1.
Upload no working.

I tryed to copy the chronocontacts.php from the one working RC1 to RC4, no results.

I tryed with your amended file as well, no uploading.
And neither the name of the file in the record....
ARSH!

Any help^!?!:sick:
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:Allowed extensions for File Uploads not working

Postby GreyHead on Thu Dec 27, 2007 6:16 pm

Hi gg4j,

Sorry, I haven't even downloaded RC4 yet so have no idea what might have changed. I expect that Max will make a new release in the next week or so.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3779
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Allowed extensions for File Uploads not working

Postby admin on Fri Dec 28, 2007 8:29 am

Hi gg4j, as suggested at the other thread, please check paths permissions ?

Cheers

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4018
Joined: Mon Aug 14, 2006 5:29 am

Re:Allowed extensions for File Uploads not working

Postby GreyHead on Sun Dec 30, 2007 12:13 am

Hi Max,

From some work done by Blade there seems to have been a change in the behaviour of $registry->toObject() in RC3. It seems that it is exploding the piped string e.g. 'foto:jpg|gif|png' into separate array entries like [0]=>foto:jpg, [1]=>gif , [2]=>png

It looks like some re-coding is needed to work round the change.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3779
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Allowed extensions for File Uploads not working

Postby gg4j on Sun Dec 30, 2007 9:14 pm

Upload dir checked and set 777

still same problem with "array", as showned in the attached gif.

I think the problem should be there.

Thanks a lot for a help, Max & Bob!

I look forward your reply.:cheer:
gg4j
Senior Boarder
 
Posts: 62
Joined: Fri Nov 02, 2007 11:08 am

Re:Allowed extensions for File Uploads not working

Postby GreyHead on Sun Dec 30, 2007 10:55 pm

Hi Max and gg4j,

I think I have a fix for this. The problem seems to be that in some cases (maybe all) the registry string 'uploadfields' is being exploded into an array on the pipe character '|' (see my previous post).

Two code changes are needed to fix this. In chronocontact.php around line 233 replace
Code: Select all
$allowed_s1 = explode(",", trim($paramsvalues->uploadfields));
with
Code: Select all
if ( is_array($paramsvalues->uploadfields) ) {
  $allowed_s1 = implode('|', $paramsvalues->uploadfields);
} else {
  $allowed_s1 = $paramsvalues->uploadfields;
}
$allowed_s1 = explode(",", trim($allowed_s1));
and in admin.chronocontact.html.php around line 91 replace
Code: Select all
$paramsvalues = $registry->toObject( );
with
Code: Select all
$paramsvalues = $registry->toObject( );
if ( is_array($paramsvalues->uploadfields) ) {
  $paramsvalues->uploadfields = implode('|', $paramsvalues->uploadfields);
}
and I think that file uploads should work OK.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3779
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Allowed extensions for File Uploads not working

Postby admin on Tue Jan 01, 2008 7:42 am

Thank you very much Bob, I will test this with RC4 and hopefully get the new release ASAP! :)

Happy New Year for you and for Everybody!

Sincerely,

Max
ChronoForms/ChronoConnectivity/ChronoComments Developer Thanks for using our components!
If you have any problems with any extension please tell us.
If you like any of our extensions please post a review at Joomla.org
Want users to submit their content to your website ? try Submit Story
Want to list/edit/delete your data ? try ChronoConnectivity
Want to have stylish AJAX comments ? try ChronoComments
User avatar
admin
Platinum Boarder
 
Posts: 4018
Joined: Mon Aug 14, 2006 5:29 am

Re:Allowed extensions for File Uploads not working

Postby Blade on Tue Jan 08, 2008 6:33 pm

Thanks for all the help guys, this solved all my upload problems, including in RC4.

Have a Bug-free New Year!
Blade
Fresh Boarder
 
Posts: 2
Joined: Tue Dec 18, 2007 10:41 am

Re:Allowed extensions for File Uploads not working

Postby BandcaveMan on Thu Jan 17, 2008 3:05 am

Not sure how this relates to this thread, but I just learned something worth sharing. I set up a form for file uploads and when submitting the file via the form, an error msg said "Sorry, your uploaded file type is not allowed"

I had included this line in the file uploads tab "datafile:jpg"

What I then realized is that it must be CASE sensitive. I changed it to "datafile:jpg|JPG" and it now works. Most of my jpegs from my camara are stored in upper case when I transfer them to my computer or browse to the camera for the file.

I was trying to upload files like xxx.JPG and it did not work, now it does.

I would recommend a code change converting this to lowercase prior to acting upon it.

Anyway, hope this helps someone who may be stuck...

BandcaveMan
BandcaveMan
Fresh Boarder
 
Posts: 6
Joined: Wed Oct 03, 2007 4:25 pm

Re:Allowed extensions for File Uploads not working

Postby GreyHead on Thu Jan 17, 2008 5:14 am

Hi bandcaveman,

That's a known bug, it's fixed in 2.3.7 for Joomla 1.0.x and I'm sure Max has it fixed for the next release for Joomla 1.5 too. To fix for Joomla 1.0.x please upgrade to the current 2.3.7; for Joomla 1.5 make these changes in chronocontact.php

a) at about line 240 replace
Code: Select all
$allowed_s3      = explode("|", trim($allowed_s2[1]));
with
Code: Select all
$allowed_s3      = explode("|", strtolower(trim($allowed_s2[1])));
and at about line 257 replace
Code: Select all
if ( !in_array($fext, $allowed_s3) )
with
Code: Select all
if ( !in_array(strtolower($fext), $allowed_s3) ) {
I think those are the only changes.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3779
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Next

Return to ChronoForms Bugs

Who is online

Users browsing this forum: Gigabot [Bot] and 2 guests