View Full Version : A HTML question...
Shirty
April 9th, 2003, 04:08
Hi. I know I hardly ever come onto this board, but I need some help and advice on a certain issue, and you all seem very wise to me. :)
1a. I've been told that there is an UPLOAD option for use in the FORM tag; would that upload to the server? (I'm worried for security reasons). Instead, I'd like to construct a form where pictures can be sent as an attachment to a certain email address, but I'm not sure if that's possible - is it? I also think I'd need to somehow prevent people from submitting a picture over a certain size (say, 25k, for example). Can this be done with Javascript?
1b. Or, if anybody knows any remotely-hosted scripts that do that, I'd be very grateful.
Thanks in advance for your help. :cool:
ansa
April 9th, 2003, 09:46
The "upload" is kind of the whole point of the <form> tag, as in it lets you submit info to a specific proggie on the web server via the CGI spec.
pictures being sent to an email: yes it's possible, and very easy. but you'll need to learn the basics of collecting info from <form>'s first.
there are several ways to check the size of an upload, all very specific to the language used though.
I don't know about remotely hosted scripts, but you could check out places like hotscripts.com, i'm sure there are several scripts already written for the kind of thing you want to do.
regards,
Andy.
zoobie
April 14th, 2003, 03:48
Nothing with email is easy...but yes, it can be done using a serverside php/cgi/asp script.
Don't try to add the attachment using mailto:...It can't be done. :bandit2:
NONO
April 20th, 2003, 20:04
UPLOAD option for use in the FORM tag is:
<form method="post" enctype="multipart/form-data" action="your-script-link">
<input name="userfile" type="file">
</form>
it's only a form interface, "action" target link is the real execute script. what JS can do is basic checking as you want & collect variable before sending on client side.
it needs a program script (with "upload files to the given target folder" function & mail() at the same time.) to execute.
PHP script, for example:
//upload your file
$source = $HTTP_POST_FILES['userfile']['tmp_name'];
//get file size
$size = $HTTP_POST_FILES['userfile']['size'];
//move the files to your target folder
$target = "Your-Targt-Folder".basename($HTTP_POST_FILES['userfile']['name']);
(it's not a complete script)
and then, if success, add & track the variable in other function & mail () it.
else shows your error messages.
if only use JavaScript to do that, i'd like to know as well. :D
Lapras
May 5th, 2003, 16:15
It really depends what script the form is connected too.
Powered by vBulletin® Version 4.1.7 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.