• I have created a form that allows people to upload files (PDF, JPEG) but can not figure out where they are store or how to display them as a link in a blog posting. The “hyperlink” of the file in the database table simply downloads an HTML file that I don’t know what to do with. Can anyone point me to documentation on how to generate a URL for an uploaded PDF? Thanks.

Viewing 15 replies - 16 through 30 (of 30 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    Are you looking at links in the administration page (Contact -> Database) or on another page using a short code?

    I went through the exercise of uploading an MP3 to my test site. I see it with a link in the administration page and I can download it from there.

    The link does not show up on the admin or test page. The mp3 is about 3MB and I configured my php.ini and WordPress to handle this file. I get no complaints during the upload. It saves fine to the database (when I access Contact-> Database) but no link to mp3 file just the text name. I am still not sure what I may be doing wrong.

    I use this shortcode:

    [cfdb-html form=”My Form” filelinks=”link”]
    Title: ${your-name}
    Tags: ${your-subject}
    Description: ${your-message}
    File: ${file-330}
    Uploaded at: ${Submitted}
    [/cfdb-html]

    and I get this output:
    Title: My MP3 Title
    Tags: test, title
    Description: The beginning of my title.
    File: Maid-with-the-Flaxen-Hair.mp3 <– NOT A LINK
    Uploaded at: 2011-09-29 20:55:21 -06:00

    Title: My PDF Title
    Tags: second, title
    Description: Test podcast for now.
    File: Test.pdf <– THIS IS A LINK
    Uploaded at: 2011-09-29 20:41:56 -06:00

    I am also using version 2.1 of your plugin. Thanks.

    Plugin Author Michael Simpson

    (@msimpson)

    Strange. I’m not able to reproduce. Try a few things.

    • Load at the entry in the admin page. Does it have a link there?
    • Upload a different .mp3 file and see if you have the same behavior.
    • Add limit=”1″ to get just the one .mp3 entry. See if that is different

    Cool, I am starting over.

    – I added the limit=”1″.

    [cfdb-html form=”My Form” filelinks=”link” limit=”1″] Title: ${your-name} Tags: ${your-subject} Description: ${your-message} File: ${file-330} Uploaded at: ${Submitted} [/cfdb-html]

    – Uploaded a different 4.6M mp3 with a success message.
    – Checked Contact->Database and still no link to my mp3 … just text.

    I am using Firefox 7 and am testing this out on WPMulti 3.2 and configured to allow mp3 uploads.

    Still confused.

    Plugin Author Michael Simpson

    (@msimpson)

    Ok, it looks like for some reason the mp3 files are not getting saved to the DB. I think the output is working OK but the issue is on the input side.

    Possible issues:
    1. This plugin fails on its operation to insert the file into the DB
    2. This plugin never sees the file because it is blocked by CF7 plugin.

    On 2, If you have not already,
    — verify you increased the limit of your CF7 file-330 field to accept 5mb size files or better.
    — Verify you recieve these fields in email from CF7 after submission.

    After that, If you have a php error log file then check it for errors in it to help give us a clue. To set an error log file, edit (or create) a php.ini file in the root of your WP install with a line like:
    error_log=/path/to/error_log.txt

    I configured the error log pointer. No file was created when I uploaded another mp3. Within CF7, I also set the upload limit to 10MB.

    <p>Title (required)
    [text* your-name] </p>
    <p>Tag
    [text your-subject] </p>
    <p>Description
    [textarea your-message] </p>
    [file* file-330 id:podcast class:podcast limit:10485760 filetypes:mp3|mp4|m4a|wma|pdf]
    <p>[submit “Submit”]</p>

    I currently have mail disabled for performance issues. :s I hope that is not the problem.

    Plugin Author Michael Simpson

    (@msimpson)

    try re-enabling mail temporarily then test a submit

    Ok. I am getting mail and the files are attached! ?? What can I say?

    Plugin Author Michael Simpson

    (@msimpson)

    Scratching my head here. Another possibility is that it is a problem in the attempt to insert the file into the database. It gets inserted into a LONGBLOG column. I started looking on the web for memory or MySQL-related issues with doing this.

    You might check your memory settings:
    https://www.fastsecurecontactform.com/php-memory-limit

    Things you might look at MySQL max_allowed_packet:
    https://www.justskins.com/forums/problem-on-inserting-data-115342.html
    https://www.webyog.com/blog/2009/08/10/mysql-server-has-gone-away-part-1-max_allowed_packet/

    I took a break from this bug. I uploaded your latest release and what can I say … it works now! Thanks for your support. Keep up the great work. Please consider a donation link.

    Plugin Author Michael Simpson

    (@msimpson)

    …yeah, I meant to do that…(not sure how I fixed it, but I’m glad it’s fixed)

    There is a donate button at the top of the plugin website https://cfdbplugin.com/. Feel free to shower me with all your hard-earned money. ??

    I should have spent more time looking. I’m currently testing out the plugin and noticed the issue is back for files over following 7MB. The problem is that I can download the attachment but it is not linkable at Contact->Database->MyForm. I increased the max-allowed-packet in mysql. I am also having trouble including the “filelink”. I does not appear to work.

    Plugin Author Michael Simpson

    (@msimpson)

    Disappointing.

    First: be sure you are using “filelinks” (s at end) not “filelink”. (I think you just did a typo in your message, but just want to check your short code is correct).

    You say you can download the attachment but it is not linked in the Database admin page (do I understand right?). So how are you downloading it? Is a link produced somewhere, or are you manually composing the link?

    The following query should identify all files saved in the DB. Is the file in question there? And are there any zero-length files?
    SELECT * FROM wp_cf7dbplugin_submits WHERE length(file) is not null

    Thanks, this is issue is now resolved. The SQL max_packet setting fixed the issue. This is issue also relates to this bug report

Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘Where do I find a URL for uploaded files’ is closed to new replies.