This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Changing DATA_DIR and UPLOAD_DIR


  1. philipwareham
    Member

    Hi there,
    I'm having some problems with uploaded files with MachForm as follows..

    I have all the machform files installed in a directory labelled 'machform', and my form is called using the php embed method from a page within a directory labelled 'scotts'. The data folder is fully writeable and is still within the 'machform' directory as per the default installation.

    When someone uploads a file using the form, it is uploaded absolutely fine into the directory machform/data/form_1/files/ and I can grab it fine via FTP - the problem is that on the automated email response, when I click the link in that email I get a 404 error.

    Looking at the URL is seems to be looking in the 'scotts' directory for the files, for example...

    http://www.mysite.com/scotts/download.php?q=Zm9ybV9pZD0xJmlkPTYwNDIwJmVsPWVsZW1lbnRfMTQ=

    Surely it should be linking to within the 'machform' directory not the 'scotts' directory?

    Should I change the paths in config file (currently set as 'DATA_DIR', './data' and 'UPLOAD_DIR', './data') to absolute paths to sort this out?

    Thanks, sorry for the long post!

    Posted 14 years ago #
  2. yuniar

    Hi philip,

    Are you using the advanced form code to embed your form?
    Also, what is your machform version? check your changelog.txt file at the bottom, you'll see your current version there.

    If you are using version older that 2.2, there was some small bug with the download path indeed.
    Please contact us directly and we'll assist you there.


    MachForm Founder

    Posted 14 years ago #
  3. philipwareham
    Member

    Hello yuniar,
    Yes I'm using the advanced form code embed, and also v2.2 of MachForm (though I had customised the helper-functions.php a bit (so the email template matched my site more closely) so maybe I copied the bug over from my previous installation of v2.1?)
    Can you let me know the scripts and line number(s) the download path fix was made in and I'll check my scripts here for inconsistency.
    Thanks,
    Phil

    Posted 14 years ago #
  4. philipwareham
    Member

    Hi again,
    I found the problem, the post-functions.php was still the one from v2.1, must of missed it when upgrading, now uploaded the latest version of it and it works fine.
    Thanks,
    Phil

    Posted 14 years ago #
  5. octochops
    Member

    I am also having this issue however it is only happening for (1) of my forms. I have another with an upload field and that one works fine.

    Posted 13 years ago #
  6. yuniar

    octochops -- can you let us know the URL to the form which having the problem?
    You can post it here or send it via email.


    MachForm Founder

    Posted 13 years ago #

RSS feed for this topic

Reply