0

I wanted to add pdf file in my articles. I have added a custom form field with type="file" in the article manager by hacking the xml and artical.php file in administrator/component/com_content directory.

But I am not able to save the uploaded files on server. What causes this?

Also I used the field type="Media" but it does not display pdf files?

TylerH
  • 20,799
  • 66
  • 75
  • 101
sameer jain
  • 147
  • 1
  • 1
  • 13
  • Hacking the core files of Joomla is not recommended. My suggestion is to check the solution provided by Ali below http://stackoverflow.com/questions/7110210/joomla-1-6-upload-file-field-in-artical-manager/7110306#7110306 – Ahmad Alfy Aug 18 '11 at 15:55
  • Have you checked whether your upload form sends the file to server. Your
    tag must have enctype="multipart/form-data"
    – WooDzu Aug 19 '11 at 00:43
  • Yeah, I changed the form tag to be enctype="multipart/form-data". But still do not see the files in the "images" directory? If I am not wrong file will be uploaded to this directory by default? – sameer jain Aug 19 '11 at 05:46

1 Answers1

1

I had a requirement a while back where with every articles they wanted to be able to attach files for download. The trouble was that the end user had to be able to do this and they were not very tech savvy. I used this Joomla attachment extension and it has worked like a charm. I would recommend it.

In your case I would check the directory where the files are being uploaded, see if it has permissions that would allow files to be uploaded. Can you upload images fine and attach them in an article?

Update This attachment does not work with Joomla 1.6+, the developers do have a plugin that is in Release Candidate stage that you can use.

Ali
  • 12,354
  • 9
  • 54
  • 83
  • This is still in testing so need a workaround until its available. If I use a type="file" field in the article manager, I am not able to specify any directory?Also why I can not insert a pdf document but images in article editor? – sameer jain Aug 19 '11 at 05:53
  • The editors actually have some sort of filters on them to prevent certain types of code, you can try disabling the filters for you more on this here http://docs.joomla.org/Why_does_some_HTML_get_removed_from_articles_in_version_1.5.8%3F I would recommend just upload the files (using ftp) to your media directory and code in anchor links with the full url in your article. Also, the above plugin in a release candidate so should be stable. – Ali Aug 19 '11 at 10:06
  • Actually my site design is totally different. The download link can not be inside the article text. So I asked my client to upload pdf file on ftp, with the name of title_alias of the article, using the media manager. Thank you your help anyway. – sameer jain Aug 29 '11 at 14:16