Hi Jesse,
A bit longwinded but I'd probably put some code in the OnSubmit Before to move the file from ChronoForms generic upload folder to wherever you want it. At the same time you can build the link to it to go into the email.
This is 'safer' than hacking the CF code as you don't have to re-hack on an upgrade. And, unless the files are very big, moving them twice probably won't cause any significant problems or delays.
Bob
PS Max is much more familiar with the v3 code and may have a better suggestion.
Hi revive, this upload folder is constant ? or depending on the user ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Yes, the folder location is constant... and the files range in size from 40MB to 70MB each... one per upload.
Also, due to the size of the files,.. is there a way to make the submit button work only once and have a java window pop up that says its uploading, and then closes when its done, leaving the user to see the redirected page?
Thank you! You guys are great!
Hi revive,
if you want to change the upload path then find and change this line at components/com_chronocontact/chronocontact.php:
$uploadedfile = JFile::upload($original_name, JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.$filename);
a JS upload image is not hard to do, you can tie a popup to the button click the any popup blocker will block it I think!
Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hey Max,
Thank you!! I'm not too savvy what it comes to forms and JS... could so head me in the right direction with the HS progress bar / or / pop up til the file uploads??
Cheers
Hi, I really never did it before, maybe google "JS File upload bar" or indicator... but I don't have something to give about this!
Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hey Max,
No worries,.. I'll search google and see what we come up with.. thanks again! The support here is second to none!
I will be discussing your extension with the site owner, with my recommendation to purchase the license and support you in this project!
Thanks again!
Jesse
Thanks revive!
Best regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi All,
My question is related to uploading files, but I'd really appreciate a solution without having to go in the code:)
I want to have my users upload images to my site using Chronoforms, and then I want these images to be viewable from a different component (phocagallery, RS2 gallery, etc) I want a great form for good user experience in upload, and great display by other specialized components. Of course I want to have the images searchable by category, username, date, etc...
Basically a photo sharing site.
Any idea how to integrate these two functionalities?
Thanks a lot
Elias
Hi Elias, you will need to examine whats necessary for phoca to list the photos (Basically data get stored in some table and images uploaded to some place) then the form should do this so I'm sure 200% that you will need to use code more than the one above!🙂
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Hi eliasdabbas,
PhocaGallery supports fornt-end upload, you might want to look at that. I think that the upload process adds categories, saves to a user folder and creates a thumbnail so there is quite a lot of processing that you will need to design and build to have CF form do this for you.
Bob
Will it work if I change the "uploads" to "http://www.mysite/com/images/etc.?
Like:
$uploadedfile = JFile::upload($original_name, JPATH_COMPONENT.DS.'http://www.mysite/com/images'.DS.$formname.DS.$filename);
$attachments[$allowed_s2[0]] = JPATH_COMPONENT.DS.'http://www.mysite/com/images'.DS.$formname.DS.$filename;
Am I right? Or is it wrong?
Thanks!
There are multiple lines that has the path:
1. if(!JFile::exists(JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.'index.html')){
if(!JFolder::create(JPATH_COMPONENT.DS.'uploads'.DS.$formname)){
JError::raiseWarning(100, 'Couldn\'t create upload directroy 1');
}
if(!JFile::write(JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.'index.html', 'NULL')){
JError::raiseWarning(100, 'Couldn\'t create upload directroy 2');
}
2. if ( $fileok ) {
$uploadedfile = JFile::upload($original_name, JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.$filename);//handle_uploaded_files($original_name, $filename);
$posted[$allowed_s2[0]] = $filename;
JRequest::setVar($allowed_s2[0], $filename);
if ( $uploadedfile ) {
$attachments[$allowed_s2[0]] = JPATH_COMPONENT.DS.'uploads'.DS.$formname.DS.$filename;
3. {
$uploaded_files = "";
$upload_path = JPATH_SITE.'/components/com_chronocontact/upload/';
if ( is_file($uploadedfile) ) {
$targetfile = $upload_path.$filename;
while ( file_exists($targetfile) ) {
$targetfile = $upload_path.rand(1,1000).'_'.$filename;
}
move_uploaded_file($uploadedfile, $targetfile);
$uploaded_files = $targetfile;
}
return $uploaded_files;
}
Do I have to change the "uploads" to "image" and the last one /components/com_chronocontact/upload/ to /images/myimages/ ??? Or just change the frst 2 lines :
$uploadedfile = JFile::upload($original_name, JPATH_COMPONENT.DS.'http://www.mysite/com/images'.DS.$formname.DS.$filename);
$attachments[$allowed_s2[0]] = JPATH_COMPONENT.DS.'http://www.mysite/com/images'.DS.$formname.DS.$filename;
And don't touch the rest?
Hi Nikkole,
why are you trying to change this ?
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
I am trying to change this (if it is possible, if not I will leave it like that) so I should be able to access/view the uploaded images through joomla admin backend, instead of going to FTP and download them. There is a media folder in joomla where all the images are stored in. Or is there any other way to view or download or use the uploaded images?
Hi Nikkole,
as you said, only FTP, that's correct, you will need these changes to edit it, give it a try and let me know what happens!
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.