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

Can I display the uploaded file on a webpage?


  1. isak
    Member

    I have a webpage that displays the data entered via machform. Help? How can I display the photos that were uploaded for each record?
    Here's the webpage I am working on: http://www.gunn.net/allListings.php

    Posted 14 years ago #
  2. neilo
    Member

    Hi isak

    Presumably the address, price, details, rooms etc are drawn from columns in a dataset which refers to a mysql database, and the values are placed in various cells in a table which is a repeating region.

    In the image cell of the repeating region in allListings.php there is currently no call to any data and is printing as <img src="" alt="Sandra Gunn Properties in Houston | Houston Reale Estate" width="150">

    The <img src="" bit is empty.

    You would need to add between the "" the path to the images folder where they are stored (something like ../images/imagessubdirectory/) and the recordset & filename column name from the database.

    For instance,

    <img src="../images/imagessubdirectory/<?php echo $row_Recordset1['filename']; ?>"
    alt="Sandra Gunn Properties in Houston | Houston Reale Estate" width="150">

    You'd have to put in the correct name of the recordset and path to the images folder and column name.

    I think . . .

    Posted 14 years ago #
  3. isak
    Member

    I have played with several options for the img src -- even trying the absolute path up to the point where the <?php echo... starts and none have work. To get the upload to finally work, I had to place a folder named "files" in the data folder.

    If I type in the actually absolute path to the file, I get this error: You don't have permission to access /path/to/folder/element_158_a777ed8cac5080ac4a28507fdeb90d56-1005-robinhood-ext-sm.jpg on this server.

    Could this be the problem? If so, how do I get around it. The permissions seem correct for accessing this file.

    Posted 14 years ago #
  4. neilo
    Member

    Hi isak,

    I suspect - an hopefully someone will correct me if I'm wrong - that the reason the folder wasn't created automatically - and the reason for the error message about permission - is that you haven't set the permissions on the data file to full write access.

    If you look in the 'Installing MachForm.pdf' that came with the program, you will see this:

    "4. Set folder permission
    MachForm requires the data folder to be writable. If you are using Linux, use the chmod
    command (example: chmod 777 data). If you are using a Windows FTP client to upload the
    files, such as SmartFTP or CuteFTP you can simply right click to the folder and choose the chmod command and set the permission into writable."

    Once this is done, all should be well. If you need help with this, you will need to let us know what method you are using to upload the files to your hosting server - i.e. what program (FTP or Dreamweaver etc.), - if your hosting control panel gives you access to an ftp browser, or any information that may help.

    But I'm 99% sure that this will be the problem. We'll sort it out.

    Also, is your MachForm installation on the same server (www.yourdomain.com) as the page that is using it?

    Posted 14 years ago #
  5. isak
    Member

    No... permissions are correct. And yes, Machform is on the same server and the page that is using it. The folder name is NOT machform. But I don't see why that would affect the outcome with this error message. The server error log says: client denied by server configuration: I have emailed them to see if they see anything from their end, but nothing back from them yet.

    Posted 14 years ago #
  6. neilo
    Member

    Hi Isak, I am at a loss - have posted to ask Redityo or Yuniar to take a look.

    Posted 14 years ago #
  7. redityo

    Hi,

    Neilo, Thank's for your help!

    @isak:

    it's possible to show your form url in here ? otherwise you can send it to here :

    customer.service[at]appnitro.com

    we'll help you to find the solution for this


    MachForm Support

    Posted 14 years ago #
  8. Saghalie
    Pro Member

    Isak,
    How are you getting images in to the img tag? Is it all done manually or is the php code grabbing it from a (MySQL?) database?

    If the code is grabbing it then you might have permissions issues with the root directory of the php files (since some php files are dynamic).

    Saghalie
    http://www.kcmhosting.com

    Posted 14 years ago #
  9. isak
    Member

    Saghalie -- The images are being grabbed by the php code when the page is displayed from a MySQL database. The error log shows this message (so does trying to access the image via absolute url in a browser): You don't have permission to access /folderName/data/form_7/ on this server. I have been in touch with the hosting provider, but frozen molasses moves faster.

    I am thinking maybe it has to do with amneding an .htaccess file, but I don't know much about them. Just starting to read about them now.

    redityo -- Here is the page -- http://gunn.net/allListings.php -- that is pulling from the database. I will email to you the form address. BTW... only the last property on the page has a photo uploaded. The Robinhood listing.

    The web page is pulling the text from the database just fine, but not the photo which has been uploaded to the same database via the same form.

    Posted 14 years ago #
  10. neilo
    Member

    It's strange that the upload was able write that one image to the data/form_7/files folder, and then have problems with permission for the rest. I had a similar problem with other software writing files to a folder, - it turned out that the software had somehow chowned (changed owner) of the folder from me to the server, and refused to let me reset the permissions. (I couldn't delete the folder or the image files inside either). The hosting providers said it was because they were using PHP version4 x and would be solved when PHP 5 x was installed on their server. They chowned the path back to me.

    Out of interest, have you checked the current permissions of the data folder (should be 777) and the sub-directories ( /form_7/files )? If they have been reset back to (say)755 what happens when you set them to 777? Do the non-appearing image files currently show as existing in the server's data/form_7/files folder?

    Do the image filenames show in the database table for all the listings or (presumably) just that one?

    Posted 14 years ago #

RSS feed for this topic

Reply