Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Please help me - regex still failing

Please help me - regex still failing 07 Oct 2012 06:27 #4295

  • whispiri
  • whispiri's Avatar
  • Offline
  • Junior Member
  • Posts: 32
  • Thank you received: 1
  • Karma: -3
Hi,

I have been searching this out through out the forum. I have found every thread I can find. I still cannot get the regex to line up.

I am still getting this error both in the Sandbox and on my own server in the downloaded component when uploading images;

- jqv:custom rule not found - file

I have tried changing the regex over and overe again (now that I know what those threads are referring too) and still nothing is changing. One thread even said to check my php.ini file. Although I couldn't find it on my server, I installed the component to my WAMP server, checked the PHP.ini file and still....I get the same error.

I have also cleared my cache - still the same error occurrs.

I have also used firebug - nothing seems to come up.

I can still upload the image but not with out the page popping up that error at least twice.

Is there a regex setting that I can try to make it work? To eliminate image uploading is not an option in this component.

Thanks in advance

Shannon
whispiri
The administrator has disabled public write access.

Re: Please help me - regex still failing 07 Oct 2012 12:53 #4298

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi there Whispiri,
from what i understand is that you have a image upload problem however i am a little confused as you also speak or RegEx?

Firstly,
Is it possible that you actually mean MIME such as...
- application/msword
- application/pdf

Secondly,
- What cook Build version are you using (1.5 or 2.0beta)
- from the error description of " - jqv:custom rule not found - file" i draw that you have defined a custom MIME type
- I have seen this in a 1.5 build

MIME Check failures can also be related to different file and folder permissions, there is no common solution and as i have found out in the past it is very much server specific

Willing to help but please be patient it may not be a quick fix, to help us assist could you kindly provide some additional information

Q1 - what operating system are you using for your WAMP server
- Windows file permissions are handled in a different way

Q2 - could it be that you are trying to set up a MIME type that the sand box will not handle
- it would also help us to assist if you could provide details of the file type you are trying to build a custom rule for such as .docx as the mime validations may be a little different

Q3 - cant find php.ini?
- "One thread even said to check my php.ini file. Although I couldn't find it on my server" => is this a hosted server?
some hosts do not allow access to your php.ini file while others allow you to drop a custom php.ini in a specific area
- do you have the relative fileinfo .dll file in your php extensions directory?
- I have a php version on one of my test servers that only includes the basic .dll extensions fileinfo .dll is not even included

Q4
- can you check your php/tmp directory?
- is there any files in your php temp directory?
- once the script completes the php temp should clear (from memory)
- if there is a file in your php/tmp directory it is most likely that it is a file permissions issue

Q5
- is the com_componentname/files/"something"_files directory created?
- what is the CHMOD value on this folder?

Q6
- Can you manually upload the original file via a FTP to your site
- does your server "serve" that file type or does it prompt you to download the file when accessed from a browser
- most hosts allow you to specify additional file types... is this a registered MIME type on your host?

As i said willing to help but as you can see there could be a lot of variables along the way...

AND PLEASE REMEMBER
- MIME checks are only a small part of the file validation process and should not be used alone...
- you should always have additional code behind it that probes the file data further to "validate" that the returned MIME Type is correct
Last Edit: 07 Oct 2012 13:10 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: Please help me - regex still failing 07 Oct 2012 16:19 #4305

  • pbianco
  • pbianco's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 2
  • Karma: 1
Hi,
I am having the same problem.
In my component I would like the user to upload a gpx file, which is the extension for GPS exchange.

Since there is not an official MIME type associated to this kind of file, a suggestion I have found is to use application/gpx+xml as MIME type; I have inserted this MIME type in the File field of the database where I want the filename has to be stored.

When I upload the file, I also get the message:
- jqv:custom rule not found - file
If I retry, most of times the file is uploaded on the server (unfortunately, since there is not the indication of the progress of the upload, maybe that simetimes I have stopped the upload before it finishes).

This problem occurs both on the Sand box and on the real site (I am using JCook 1.5).
My site is hosted and I cannot retrieve the php.ini info.

May be that the problem is the mime validation?

Thanks and regards
The administrator has disabled public write access.

Re: Please help me - regex still failing 07 Oct 2012 17:04 #4306

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
@pbianco
Have you tried 2.0 beta build on a 2.5.x joomla site

MIME issues will still happen in COOK 2.0beta build i guess because COOK would not have this listed a valid MIME

Have you set this MIME type on your host server?
application/gpx+XML

Joomla 1.5 is no longer supported my suggestion move onto the COOK 2.0 beta and start building joomla 2.5 components
The administrator has disabled public write access.

Re: Please help me - regex still failing 07 Oct 2012 17:57 #4308

  • whispiri
  • whispiri's Avatar
  • Offline
  • Junior Member
  • Posts: 32
  • Thank you received: 1
  • Karma: -3
Thanks for such a lengthy response.....I will quote you and then try to give you the answers in bold (that I can answer for you). Don"t worry, I can take time to work on this.....I have been working on it for the past week searching through all the forms. This is my last resort....asking you guys for help. I very junior still at working Cook!
Firstly,
Is it possible that you actually mean MIME such as...
- application/msword
- application/pdf


** I am referring to opening up JPG files. I am building a component for Pet records and want them to be able to upload a picture of their pet and a scanned JPG of the vet certificate. ****



Secondly,
- What cook Build version are you using (1.5 or 2.0beta)
- from the error description of " - jqv:custom rule not found - file" i draw that you have defined a custom MIME type
- I have seen this in a 1.5 build

****I believe it is the V2.0beta. I just recently found this builder a few weeks ago.....does that help? The only version info I can find on the main menu is V2.0 beta. *****


MIME Check failures can also be related to different file and folder permissions, there is no common solution and as i have found out in the past it is very much server specific

Willing to help but please be patient it may not be a quick fix, to help us assist could you kindly provide some additional information - Thank you so much!

Q1 - what operating system are you using for your WAMP server
- Windows file permissions are handled in a different way


**** Windows 7, but I only checked the WAMP server as a last resort******


Q2 - could it be that you are trying to set up a MIME type that the sand box will not handle
- it would also help us to assist if you could provide details of the file type you are trying to build a custom rule for such as .docx as the mime validations may be a little different

*****I am trying to set it for a JPG. It doesn't matter if it is in the sandbox, on my server or on the WAMP server, it all gives the same error. At first I didn't even set it to anything but JPG and I have tried to set different combinations in the "Rename" spot.





Q3 - cant find php.ini?
- "One thread even said to check my php.ini file. Although I couldn't find it on my server" => is this a hosted server?
some hosts do not allow access to your php.ini file while others allow you to drop a custom php.ini in a specific area
- do you have the relative fileinfo .dll file in your php extensions directory?
- I have a php version on one of my test servers that only includes the basic .dll extensions fileinfo .dll is not even included

***Still Looking. I will get back to you on this*** I do have the php.ini on the WAMP SERVER and it seemed to be set right according to that other post. I cannot find that file on my hosted account which is actually under my reseller account

Q4
- can you check your php/tmp directory?
- is there any files in your php temp directory?
- once the script completes the php temp should clear (from memory)
- if there is a file in your php/tmp directory it is most likely that it is a file permissions issue

****IS this in the component file?? Or on my server somewhere?? I can't find any such file. There was none in the main tmp directory on my hosting account. I cleared anything in the Joomla main tmp file. Doesn't make any difference********

Q5
- is the com_componentname/files/"something"_files directory created?
- what is the CHMOD value on this folder?

**** 0755 ****

Q6
- Can you manually upload the original file via a FTP to your site
- does your server "serve" that file type or does it prompt you to download the file when accessed from a browser
- most hosts allow you to specify additional file types... is this a registered MIME type on your host?

As i said willing to help but as you can see there could be a lot of variables along the way...

****I will have to get back to you on all of this. I haven't set up the ftp on this account. There has been issues with FTP'ing on this reseller account in the past but it has always been to do with FTP settings. It has never rejected me from uploading any image file in the past. I will have to set up an FTP account and check all of this.****

Thanks so far for your help. I will try to get back to you later tonight with this information. Please forgive me but my family and I are running out for the afternoon.


********************************************************
BTB300

I am sorry for taking a while to get back to you. I was taking time to check everything you said real well.

I did manage to set up my FTP and yes, I am able to Ftp up as well as upload through the cpanel on my hosting account.
1) rename file "{ALIAS}.{EXT}" without quotes

Okay, did that, still no change. I am still getting the error in both the sandbox enviroment, the wamp server and the hosting account.
2) try to upload a .jpg file in sand box (with a lower case extension)
i have seen before if you try to upload somefilename.JPG sometimes it fails because some servers are case sensitive and simply expects everything to be lowercase

I have been doing that all along but I checked it again for you. No change. since most of my images are lowercase, I also tried an uppercase just for the heck of it. Still no change. the error still pops up.
As for Windows 7 / WAMP
- Although i don't use WAMP i do run test servers on Windows 7 with apache and IIS - i will check my file permissions today and post tonight

Thank you so much
in the mean time
- In the WAMP php.ini check for a defined upload directory such as c:\php\temp (make sure its not commented out with a ; before it)

Okay, I did find it and yes it had a ; in front of it but I removed it and restarted the WAMP server. Still, it didn't work. I still get the error.

- does your internet guest user account (usually something like COMPUTERNAME_IUSR) have read and write access to the php upload directory and the file upload directory

It appears to... I was able to upload a photo through joomla in the media files section. However when I right click on that file and go to properties in the guest mode, it says "Read Only"
- check your php.ini for the maximum upload size (usually defined somewhere near the upload directory)

2 M

when the upload fails (WAMP Server)
- check the php upload directory
- is there any files in there something like sdPHP.tmp

I haven't see anything like that.
whispiri
Last Edit: 07 Oct 2012 23:47 by whispiri. Reason: Responding to troubleshooting questions
The administrator has disabled public write access.

Re: Please help me - regex still failing 07 Oct 2012 21:22 #4313

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi Whispiri,
Thanks that helps narrow down your issue YES we are dealing with MIME not RegEx
firstly in the sand box try

1) rename file "{ALIAS}.{EXT}" without quotes

2) try to upload a .jpg file in sand box (with a lower case extension)
i have seen before if you try to upload somefilename.JPG sometimes it fails because some servers are case sensitive and simply expects everything to be lowercase

As for Windows 7 / WAMP
- Although i don't use WAMP i do run test servers on Windows 7 with apache and IIS - i will check my file permissions today and post tonight

in the mean time
- In the WAMP php.ini check for a defined upload directory such as c:\php\temp (make sure its not commented out with a ; before it)
- does your internet guest user account (usually something like COMPUTERNAME_IUSR) have read and write access to the php upload directory and the file upload directory
- check your php.ini for the maximum upload size (usually defined somewhere near the upload directory)

when the upload fails (WAMP Server)
- check the php upload directory
- is there any files in there something like sdPHP.tmp
Last Edit: 07 Oct 2012 22:19 by BTB300.
The administrator has disabled public write access.

Re: Please help me - regex still failing 08 Oct 2012 04:33 #4321

  • pbianco
  • pbianco's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 2
  • Karma: 1
Hi all,
I was already using Joomla 2.5, but JCook build 1.5.
Following BTB300's suggestion, I have tried with JCook build 2.0, and now it works!!!!
In case anybody needs to do the same, I have used as MIME extension application/xml for gpx.
Thanks a lot
The administrator has disabled public write access.

Re: Please help me - regex still failing 08 Oct 2012 09:29 #4326

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Hi again
@pbianco glad I could be of some help

@ whispiri
Let's keep going with WAMP for now

Just to check that you did remove the comment ; in front of the call to the php_fileinfo.dll in the dynamic extensions section of your WAMP php.ini as discussed in my other post

extension=php_fileinfo.dll

While your there you have a maximum of 2 meg upload
- as a matter of interest what is the file size that you are uploading?
- would suggest to increase it if your intended uploads will be close to this size
- again is it uncommented?

Be back soon with file permissions
The administrator has disabled public write access.

Re: Please help me - regex still failing 08 Oct 2012 16:23 #4332

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
whispiri,
I Have downloaded and configured Fresh WAMP on Windows7 and fresh Joomla 2.5
i am able to upload a .jpg file

The only noticeable things were...
- i had to remove the comment from the following line
extension=php_fileinfo.dll

and
- i think i had to define the temp directory as below

; On windows:
; extension_dir = "ext"
extension_dir = "c:/wamp/bin/php/php5.4.3/ext/"

Just a few things i noticed as well
- in the php.ini file i am sure they have often used SYS:\...
SYS:\somedirectory\anotherdir in place of C:\somedirectory\anotherdir

* would it be possible that your WAMP server is on a different partition to your Operating system (if it is change SYS:\ to the actual directory)

Have you checked the the phpinfo() configuration to make sure your php.ini is loaded from your WAMP directory
- such as C:\wamp\bin\php\php5.4.3\php.ini

Failing all that - Its looking like a file / folder permission issue....
Last Edit: 08 Oct 2012 16:24 by BTB300.
The administrator has disabled public write access.

Re: Please help me - regex still failing 08 Oct 2012 17:06 #4334

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Just another thought have you
- tried to delete the upload field
- then run in the sand box
- then recreate the upload field again
- then run in the sand box

What happens if you create a new project

- simply a table with two fields A string and an upload field
- Create a collection and item view for both frontend and administrator
- Download it as Cook version2.0 beta - test it on joomla 2.5



And just to make sure
When you define the rename property
{ALIAS}.{EXT} did you type exactly that In to the field and save it?
- You DON'T specify anything special here such as file extension

Simply put ALIAS}.{EXT} into the box
The administrator has disabled public write access.

Re: Please help me - regex still failing 08 Oct 2012 17:08 #4335

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Sorry typo should have beenBTB300 wrote:
Simply put {ALIAS}.{EXT} into the box
The administrator has disabled public write access.

Re: Please help me - regex still failing 09 Oct 2012 00:00 #4338

  • whispiri
  • whispiri's Avatar
  • Offline
  • Junior Member
  • Posts: 32
  • Thank you received: 1
  • Karma: -3
*******************************************************************

Well I have made some progress but not good enough. It is bringing some questions to mind.

First of all, I feel like a dumb blonde. I thought I had it set to download to Joomla 2.5. I guess not. Now I know, lol.

And I did do a new test project. And here is what I found out;

I made one table with two strings and an image. I set it to take all image types; png, jpg, bmp etc. And I placed the {ALIAS}.{EXT} in the Rename field as asked to.

In Sandbox I still seemed to get the error but when I downloaded the component and installed it to the hosting server, it worked perfectly in the backend. I didn't test it in the frontend.

So I went back to my old project and I deleted the image fields on the old project. And then I re-inserted them this time setting them to the settings of the previous test component.

I downloaded (in beta joomla 2.5 as I did with the test) and uploaded it to the hosting server. And I still got the error.

Questions;

1) The only difference was that I formatted the pages for thumbnails of 125X125 and I set it for modal preview, etc. In the test file I didn't do this. Could that affect this?

2) Should I start the project completely from scratch? It's not huge but it still will take me a few hours to re-do it.
whispiri
Last Edit: 09 Oct 2012 00:46 by whispiri. Reason: updating my troubleshooting
The administrator has disabled public write access.

Re: Please help me - regex still failing 09 Oct 2012 04:29 #4339

  • whispiri
  • whispiri's Avatar
  • Offline
  • Junior Member
  • Posts: 32
  • Thank you received: 1
  • Karma: -3
Okay,

I have rebuild my component from scratch and so far it seems to be working now in Sandbox. No errors so far. Not sure what I did differently. However, I haven't tested it on the my server yet. Will do so in the morning. It's getting late here and need some sleep. Will keep you posted.
whispiri
The administrator has disabled public write access.

Re: Please help me - regex still failing 09 Oct 2012 05:55 #4341

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Glad to see we have made some progress :cheer:

As for starting from scratch
- if it was a small project perhaps a few hours spent on a fresh / clean build was worth it
- i guess thats just the nature of computers sometimes there can be "something" left behind in the code for whatever reason...

Even MR Gates has not figured it out
- Windows OS most used solution is "Start Again" (Start - Shut Down - Start Again) :P

So Just to confirm when you download and test your new project in the morning...

new project
BUILD = (Cook 2.0beta / Joomla 2.5)

LOCAL WAMP SERVER
Backend - .jpg upload working?
Frontend - .jpg upload working?

COOK SAND BOX - .jpg uploads working
Backend - .jpg upload working?
Frontend - .jpg upload working?

HOSTED PRODUCTION SERVER - if you have error with .jpg uploads
use a FTP program to view the folder structure
Q - what version PHP is your host running
Q - is the relative folder created for the uploaded pics such as
/components/com_testupload/files/uploadedpics_file
Q - if the uploadedpics_file folder is present what is its CHMOD value
Last Edit: 09 Oct 2012 06:17 by BTB300.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: Please help me - regex still failing 11 Oct 2012 06:22 #4376

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Thanks BTB300 for the help,
The only difference was that I formatted the pages for thumbnails of 125X125

A little tip about the sizes :
If you change the thumbsizes in your component after downloaded it, be sure that you added a new size format in the classes/file.php because there is a security to avoid the user to create unlimited images sizes.
(Protect cache files creation, protect memory, protect CPU)
Coding is now a piece of cake
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.095 seconds

Get Started