File/Image Upload write url into DB

platinumboy 15 Sep, 2008
Hy there,

i'm new here in this forum, because i had to solve some problems with the chronoforms comp. First of all i have to apologize for my bad englisch πŸ™„

My Problem is, that when somebody submits a form, he also can upload a image to the server. All works fine, i disabled the file attachment to emails and the file is also uploaded to the server.

But i can't access the file directly for example in the submitted mail to the admin ... i don't have the rights to view the file. I changed the permission for the upload directory to 744 ... but if a file is uploaded the permission for the file is 600. So if i try to access the file directly i get an error message. So i have to give each file the right permission with Filezilla manually ... but this is very frustrating, to change this on 100 files or more. Have can i solve this problem?

Another problem is, that the url of the upload file isn't stored in the database. If i look in to the CF Component and click on "show saved data" each field has an entry, but only the field with the image has no entry. There should be stored the url of the uploaded file ... how can i do this?

Would be very nice if you can help meπŸ™‚
Max_admin 15 Sep, 2008
Hi platinumboy,

which CF version do you have ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
platinumboy 29 Oct, 2008
now i updated to the latest stable version 3.0 ... the upload also works fine.

but i want to write the url of the uploaded image into a field.

on the faq-page i read, that you can access the files by using

$attachments['field_name']

but where should i enter this?
Max_admin 29 Oct, 2008
Hi, in the onsubmit after email, write some code like :

JRequest::setVar('image_field_name', 'http://www.yourdomain.com/components/com_chronocontact/uploads/formname/'.$attachments['field_name']);


Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
platinumboy 06 Nov, 2008
when i add this code i got this error message

Fatal error: Class 'phpJRequest' not found in /var/www/web36/html/artolino/components/com_chronocontact/chronocontact.php(533) : eval()'d code on line 1
GreyHead 06 Nov, 2008
Hi platiumboy,

Lokks like there isn't a space or a line return between the php tag and your code
<?phpJRequest . . .
should be
<?php
JRequest . . .

Bob
platinumboy 06 Nov, 2008
ok thanks now it's workingπŸ™‚
This topic is locked and no more replies can be posted.