Developer Support »

Clickable link to uploaded files  (See more user questions)

Hi Charles,

Absolutely spot on. You've been a massive help and i appreciate your persistence. If I can leave feedback for you anywhere, please let me know.

I have managed to put the form with the captcha on both my websites below. This is a great help now and hopefully customers will be happy
being able to send me images from the form.

Once again, thank you so much. I am already recommending you to a few of my suppliers who do not use forms on there websites. Hopefully more sales for you.
Many Thanks

From: FormToEmail.com
Sent: Monday, August 30, 2010 2:22 PM
Subject: Re: Contact

Hi .

Yes, getting somewhere. Looks like your PHP setup doesn't have all the
server variables available to it. It doesn't seem to recognise
$_SERVER['DOCUMENT_ROOT']. In itself this isn't a problem. All the server
variables aren't always available.

I have attached your script again with some changes. I changed this line:

$web_location =
str_replace($_SERVER['DOCUMENT_ROOT'],"",$path_to_uploaded_file);

...to this:

$web_location = "/emailimages/";

I also change the path to upload the files to, to put them in your
/emailimages/ directory. I changed it to this:

$path_to_uploaded_file =
"/home/someuser/htdocs/example/emailimages/";

I got the above path from the information you got back below (it assumes the
/emailimages/ directory exists on your webspace).

All being well, your uploaded images should go to your /emailimages/
directory (http://www.example.co.uk/emailimages/) and you should get a
clickable link in the email to them.

Any questions, just let me know.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

----- Original Message -----
Sent: Monday, August 30, 2010 1:16 PM
Subject: Re: Contact

Hi Charles,

The link to the images have now become clickable to view, but, wrong link.
This is the link i get:
http://www.example.co.uk/home/someuser/htdocs/example/DSCF1982.JPG
but it needs to be, http://www.example.co.uk/DSCF1982.JPG or i prefer
to create a new folder for the images to go to like emailimages like before.
This way it keeps my server looking straight.

Looks like we are getting there and i appreciate your help on this.
Many Thanks

From: FormToEmail.com
Sent: Sunday, August 29, 2010 7:54 PM

Thanks for the good info .

I have attached your script, with a slight edit to the code, whereby it is
not conditional on your files being web accessible to write a link in the
email.

(Yes, that was right about web accessible, meaning they be accessed from the
outside world, the web.)

The only reason I have that condition in the code is because it is pointless
making a link to a directory that cannot be accessed from the web.

Give it a try, see how it goes.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

----- Original Message -----
Sent: Sunday, August 29, 2010 1:14 AM
Subject: Re: Contact


Hi Charles,

Yes i corrected the file path to the original as you suggested with the
default setting.

Yes i have tried it in hotmail with the setting above and the same thing, no
link.

I don't get what you mean if it is web accessible. If you mean can you view
the images once sent in the form in a browser, then yes. The link is
http://www.example.co.uk/DSCF2086.JPG for the latest image i sent with
the form. The directory i use for this website is called example and
the domain www.example.co.uk is pointing to the web directory
example

Yes i changed the colours of the html styling in the formtoemailpro.php. I
have reattached the formtoemailpro i have got on my server now, if this
helps. And the form is here: http://www.example.co.uk/contact.php .

The contact.php and all pages associated with this site including
formtoemailpro.php are all located in the directory example and this
is the same directory that images are now being uploaded to from the contact
form.
Many Thanks

From: FormToEmail.com
Sent: Saturday, August 28, 2010 11:20 PM
Subject: Re: Contact

Hi .

Did you try the default setting:

$path_to_uploaded_file = dirname(__FILE__) . "/";

Did you try correcting the path as I suggested?

What happens when you try it in Hotmail, same thing? Did you try it in
Hotmail with the default setting above?

If the directory isn't web-accessible, you will get the file names only.
What directory are you currently testing with? Is it web accessible?

Did you apply styling to the HTML email? It has aquired it from somewhere.
If the email is being altered after the script has written it, then I can't
possibly predict the outcome, including not showing links that are meant to
be links, which might well be the cause of your problem.

Please advise on the above, we can take it from there.

Best wishes.

Charles Sweeney
https://formtoemail.com
The world's easiest feedback script!

----- Original Message -----
Sent: Saturday, August 28, 2010 7:40 PM
Subject: Fw: Contact


Hi Charles,

Please find below the email i receive when the form is submitted.
I use windows live mail for my mail receipt. I have tested it on my hotmail
and on my own server (1and1).
I have done the php test and it can be viewed here:
http://www.example.co.uk/phpinfo.php

Sent: Saturday, August 28, 2010 7:35 PM