4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Emailing JPEG via form
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Tue Feb 05, 2002 3:24 pm (22 years, 2 months ago) Reply with QuoteBack to Top

I want users of my site to be able to send me a JPEG image via email using an online form.

All the examples I find are either too simple and don't deal with attachments or are far to complicated for my level of PHP knowledge.

Can anyone provide me with a piece of code to do this? (or failing that a link to an easy to follow tutorial).

Also,
On some of the examples I have been trying I have received a warning that SAFE MODE Restriction is in effect. This may just be mistakes in the code. I have F2S webspace (paid for). Does anyone know of any restrictions F2S has that wont allow me to do this.

Thanks in advance,
Darren
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Garth Farley
WebHelper
WebHelper


Joined: 08 Jan 2002
Posts: 69
Location: Ireland

PostPosted: Tue Feb 05, 2002 4:02 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Yes what you want is possible (I came across something similar in a tutorial on either www.hotscripts.com - upload scripts it's under). This form will cause the browser to upload their JPEGs to your server, which then you can send to yourself.

F2S does have the SAFE MODE restriction, but you can get around it by using your directory as the temporary storage place for the uploaded file (non-safe mode uses the /tmp directory on the server).

Beware of people sending you huge images though.

Garth Farley
OfflineView User's ProfileFind all posts by Garth FarleySend Personal Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Tue Feb 05, 2002 4:31 pm (22 years, 2 months ago) Reply with QuoteBack to Top

Thanks Garth,

Does that mean there is no way to email a file directly from users machine? As you say large file sizes would be an issue, although presumably file size can be limited.

I checked out Hotscripts.com and although I think I found the scripts you referred to I cant seem to download anything but a file called 'dload.cgi' which just contains nonsense. I will try later from a PC it may be a Mac thing!!

Darren
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Peter
Team Member



Joined: 09 Jan 2002
Posts: 147
Location: UK

PostPosted: Tue Feb 05, 2002 8:06 pm (22 years, 2 months ago) Reply with QuoteBack to Top

darren wrote:

Does that mean there is no way to email a file directly from users machine? As you say large file sizes would be an issue, although presumably file size can be limited.


You cannot send a file from a users machine without uploading it to the web server and then sending it. Can't you just gt them to send it as an email attachment?

File size can be limited. There's a good bit in the PHP manual about this.

________________________________
Maple Design - quality web design and custom programming
OfflineView User's ProfileFind all posts by PeterSend Personal MessageVisit Poster's WebsiteYahoo MessengerICQ Number
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Wed Feb 06, 2002 8:34 am (22 years, 2 months ago) Reply with QuoteBack to Top

The image upload is to be part of a form collecting other data, so it would be nice if it were all done together, rather than it be sent as a normal attachment. Although its looking to be more complicated than I had hoped so I may have to settle for this in the end.

My main problem now is getting around the SAFE MODE problem of not being able to upload to the temp directly. All of the turorials I've seen so far assume you have access to this and can upload to it and then copy from it to your own space. I did find a reference on the old F2S Users site to use the PHP CGI engine, would this work?

Or can I use my directory as the temp directory, as Garth suggests - I can find no mention of how to specify this, any clues?

Thanks again,
Darren
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
szo2
Junior WebHelper
Junior WebHelper


Joined: 10 Jan 2002
Posts: 18
Location: Hong Kong

PostPosted: Sat Mar 02, 2002 5:56 pm (22 years, 1 month ago) Reply with QuoteBack to Top

Although I oppose against hosting with F2S I still think I should help their users.............
AFAIK, Both solutions will work.

For the CGI PHP in F2S, you have to use .cgi as your file extension instead of .php, AND add a line on the top of the script(s):
#!/usr/bin/php
OfflineView User's ProfileFind all posts by szo2Send Personal MessageSend email
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.128271 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme