Forums

Linking to and showing uploaded files

sheilabs 03 May, 2010
I have made a chronoform that uploads files to the server.
I have also made a chronoconnect that shows the uploaded files (by reading the corresponding database table).
How do I make the list link to the files and enable to show the file when the user clicks the link?
GreyHead 04 May, 2010
Hi shielabs,

I'd just make a link in the CC body section something like this
<a href='some_url/{file_name}'>{file_name}</a>

Bob
sheilabs 04 May, 2010
Thank you, that was quite simple and it works!

It triggered two new questions. :-)

1.
Up to now I have used the default upload directory
/components/com_chronocontact/uploads/UploadFiles/
And this works, there are files in there!

I changed the upload path in the parameter called 'Full upload Path' in the form tab 'File Uploads'. I changed it to url+'/ner_upload'

Then I get the error message:
"Couldn't create upload directroy 2"

Why is this?

2.
Is it possible to add some more security in the files uploaded. Because if not, then if one guesses the prefix, it's possible for anyone logged on to access any file by typing the addresss, right?
GreyHead 04 May, 2010
Hi sheilabs,

1) Sounds like you may have got a URL instead of a path there? Probably safest to put the full path

2) Yes, that is possible. There are a couple of solutions. I think that you can put the upload folder outside the site root so that there are no urls that will access the file. That's probably the easiest. You could also replace the date-tme prefix with a random string, that needs a little coding but should also be a deterrent. (Or both.)

Bob
sheilabs 10 May, 2010
1.
First I used the default folder created when I created the upload form.
/var/www/Joomla/functest/components/com_chronocontact/uploads/uploadPath/
here, the upload worked fine.

2.
Then I created the folder nerupload/ and changed the path in the form setup to
/var/www/Joomla/functest/nerupload/
I get the error messages as shown in the attached screen shot.
[attachment=0]error_file_upload.jpg[/attachment]
Still, as the screen shot shows, the filename is created for the file I try to upload and there is a new row in the databasetable. But no file is uploaded.

3.
When I try to change the form setting back to the first folder, I get no error messages, but no file is uploaded any longer.

How do I solve this?
GreyHead 10 May, 2010
Hi Shiela,

Please post a screenshot of the File Uploads tab. This looks like a problem with folder permissions.

Bob
sheilabs 10 May, 2010
Yes, I was also thinking this might have something to do with permissions, but nevertheless it should work when I switch back to the old folder...
GreyHead 10 May, 2010
Hi Shiela,

You can see the 'Not writable' against the upload path there. That explains the problem with that folder. What do you see when you revert to the other one?

Bob
sheilabs 11 May, 2010
well, I've noticed that it sometimes says writable, but if I select the folder that was originally made for the upload by ChronoForm itself, it still says unwritable.
I've also changed the owner of the folder to 'apache' and given 777-access.
GreyHead 11 May, 2010
Hi Sheila,

If it says 'Unwritable' then the Joomla User doesn't have enough access to move the file there. I suspect that there is some security protection in place that isn't allowing the 777 chmod.

Bob
prdg1 05 Jun, 2010

Hi Sheila,

If it says 'Unwritable' then the Joomla User doesn't have enough access to move the file there. I suspect that there is some security protection in place that isn't allowing the 777 chmod.

Bob



Hi Bob, I'm having this off problem too. I've set all folders to writable and I know they are but it is still showing not writable. What do we need to do to give the Joomla user more access. Do we have to contact the server host or do you have any ideas? I normally don't run into this issue but I have a client on Dreamhost and am just having issues. Thanks
zhazhago 10 Jun, 2010

Hi shielabs,

I'd just make a link in the CC body section something like this

<a href='some_url/{file_name}'>{file_name}</a>

Bob



What if the uploaded file is a picture and i want display it instead of a link?

Best Regards
GreyHead 10 Jun, 2010
Hi zhazhago,

Use similar code with an <img . . .> tag.

Bob
jllav03 03 Jan, 2012
I'm having a similar issue. The file upload path is set correctly, it points to my server (as seen in screenshot) but when i submit a new form and attach a pdf to it, the server doesn't get it. The file path is broken.

I can manually ftp the file over to the server, when I do that the link works. I must be doing something wrong... ty

EDIT: PLEASE DISREGARD. I was missing a / at the end of Marcomm. =]
artery 02 Mar, 2012

I'd just make a link in the CC body section something like this

<a href='some_url/{file_name}'>{file_name}</a>

Bob



I am also trying to use ChronoConnectivity to list the entries and linked files submitted with chronoforms in the front-end.

I tried the code above in the body section, Frontend List Settings.
I'm using CC4.0, but nothing gets added to the table in the font-end.
I also tried changing "some_url" to:
http://www.mysite.com/components/com_chronoforms/uploads/myfiles

but can't get it to work.
Do I change "fileā€“name" and "some_url" to something else or is there something I am doing wrong?

I'm sorry about the silly question, please point me in the right direction.
GreyHead 03 Mar, 2012
Hi artery ,

You need to change both some_url and file_name. It looks as though you have a good replacement for some_url; You need to replace file_name with the name of the column in your database table where the file name is saved.

Bob
artery 04 Mar, 2012
Thank you very much Bob
I now entered this into the body section:
<a href='http://www.xxxxxxxx.com/components/com_chronoforms/uploads/cvsubmission/{input_cvfile_1}'>{input_cvfile_1}</a>


1. I replaced file_name with the database column name (tried with and without brackets), but in the front-end it only shows the database column name, not the name of the uploaded file.
2. It only shows up in the front when Auto Listing is disabled. When Auto Listing is enabled i see the complete list, but without the new body code. Do I have to remake the complete listing in the body section for the linked file to get added to the list?

I have Joomla 1.5.22
CC version 4.0 RC1

Please help. My coding skills are poor and I'm not sure what I am doing wrong.
GreyHead 04 Mar, 2012
Hi artery,

I suspect that you have a choice between the 'Auto Listing' which is a simple listing of the records of the values in the table; or a customised listing using the Body box.

Bob
zhzubair4 11 Mar, 2012
I'd just make a link in the CC body section something like this
CODE: SELECT ALL
<a href='some_url/{file_name}'>{file_name}</a>
Invidia 22 Apr, 2012
Hello,

I also tried this and nothing works.
Should I ad my column name in Frontend List Settings - General - List View Fields. If yes, something in Linkable Field(s).
Or only code in Custom Listing Settings ( Frontend List Settings - General).

I have this versions installed Chronoforms 4.0 RC3.3 en Connectivity 4.0 RC2 in Joomla 2.5.4

Thanks for your answer.

Invi
GreyHead 22 Apr, 2012
Hi Invi,

I think that if you want to build a link to the file then you have to use a Custom view. As far as I know the standard views don't let you build a custom entry.

Bob
staiaccapi 11 Dec, 2012

Hi artery ,

You need to change both some_url and file_name. It looks as though you have a good replacement for some_url; You need to replace file_name with the name of the column in your database table where the file name is saved.

Bob


I have the some problem, but i use only chronoform.
Can you help me?
Max_admin 17 Dec, 2012
Hello,

If you want to display a list of files in some directory then use some php code in a custom code action then format the results into HTML, example:
$files = glob('/path/to/dir/*.png'); //will return a list of all .png files under that path


You don't need connectivity unless you want to display a list of some records into 1 or more database tables.

Regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.