Test if file uploaded

Post any questions you may have here

Test if file uploaded

Postby ugly » Mon Feb 08, 2010 8:13 pm

I allow my users the option to upload an image, I then retreive the file name using
$filename1 =JRequest::getVar('image1');
How can I test if the user has uploaded an image? Thanks for any help here.
ugly
Junior Boarder
 
Posts: 31
Joined: Sat Nov 28, 2009 11:58 am

Re: Test if file uploaded

Postby GreyHead » Mon Feb 08, 2010 10:19 pm

Hi ugly,

You can use the Joomla JFile class to check if the file exists.

Bob
Bob Janes ChronoForms Support
*** The ChronoForms book is out NOW ***
ImageClick for more info
User avatar
GreyHead
Administrator
Administrator
 
Posts: 14754
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re: Test if file uploaded

Postby ugly » Tue Feb 09, 2010 1:47 pm

Thank you for your answer Bob. Are uploaded files parked in their new directories by the time I test for their existence in "onsubmit"?
ugly
Junior Boarder
 
Posts: 31
Joined: Sat Nov 28, 2009 11:58 am

Re: Test if file uploaded

Postby GreyHead » Tue Feb 09, 2010 3:43 pm

Hi ugly,

Yes, I think so. They are certianly in place by the time emails are sent. I think they are the first action after checking form permissions.

Bob
Bob Janes ChronoForms Support
*** The ChronoForms book is out NOW ***
ImageClick for more info
User avatar
GreyHead
Administrator
Administrator
 
Posts: 14754
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: yaksushi and 8 guests

 

Who is online

In total there are 9 users online :: 1 registered, 0 hidden and 8 guests (based on users active over the past 15 minutes)
Most users ever online was 109 on Mon Jul 05, 2010 6:59 pm

Users browsing this forum: yaksushi and 8 guests

Current time

It is currently Fri Sep 10, 2010 11:29 am