Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
ccesca #1
PHP script for form to upload 2 files to FTP
Hi,
I have scoured the internet for quite a while now looking for a free php
script that will enable me to:
1. Put a form on a page that has two uplaod boxes for a client to upload two
file svia theeir browser
2.The files will be one image (jpg) and one pdf
3. The files will always (each day) be called headshot.jpg and resume.pdf
4. The script must allow the files on the server to be overwritten by the new
files of the same name each day
I have found MANY scripts, som eof which i can get to work, but they were too
sofisticated (checked for many things taht i was not concerned for, didnt allow
files to be overwritten, changed directories of where the files were uplaoded
to, changed the file names automatically) and many that i wasnt able to get to
work.
I just need something simple like the above. Unfortunately I am no scripter,
so when i tried to decifer the ready made scripts and rearrange them to suit my
needs, i messed things up.
Thanks immensely in advance of anyone who canb offer m eany help or point me
in a better direction. I wasnt sure where to post this query/help plea.
Cheska
ccesca Guest
-
PHP - upload files thru form - security question
I finally succeeded in uploading files to a server thru a PHP-form. Last obstacle was permission denied to copy the file from tmp directory to the... -
file upload form enctype="multipart/form-data
I'm upload a file using cffile upload and that seems to work fine except I need to use enctype="multipart/form-data on the form side. This isn't a... -
Upload Multiple Files in one form
I am trying to upload the track information for cd's, and also upload the audio sample files at the same time. The samples are real media at this... -
form upload images using php form script
Hi, I normally use CGI to process my html forms. However, this time I need/want to use PHP. Can anyone point me in the direction of a php... -
Upload files to site, upload info to SQL?
I want to create a _SECURE_ interface from an html form that allows certain people within my company to upload files into a predetermined directory... -
Murray *ACE* #2
Re: PHP script for form to upload 2 files to FTP
Go to [url]http://www.php.net[/url] and read about file uploads there. You will find
several scripts that will work just fine for you.
Or try this -
<?php
//places files into same dir as form resides
if(isset($_POST['Submit'])) {
$target=$_SERVER['DOCUMENT_ROOT']."/uploads";
foreach ($_FILES["files"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["files"]["tmp_name"][$key];
$name = $_FILES["files"]["name"][$key];
if(move_uploaded_file($tmp_name, "$target/$name")}
print "Upload completed";
else
print "Upload failed";
}
}
}
?>
<body>
<form action="" method="post" enctype="multipart/form-data">
<p>Pictures:
<input type="file" name="files[]" />
<input type="file" name="files[]" />
<input type="submit" name="Submit" value="Send" />
</p>
</form>
This assumes that the incoming files will be properly named, and that the
upload destination is a folder called "/uploads".
--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"ccesca" <webforumsuser@macromedia.com> wrote in message
news:e742fb$4s6$1@forums.macromedia.com...> Hi,
>
> I have scoured the internet for quite a while now looking for a free php
> script that will enable me to:
>
> 1. Put a form on a page that has two uplaod boxes for a client to upload
> two
> file svia theeir browser
> 2.The files will be one image (jpg) and one pdf
> 3. The files will always (each day) be called headshot.jpg and resume.pdf
> 4. The script must allow the files on the server to be overwritten by the
> new
> files of the same name each day
>
> I have found MANY scripts, som eof which i can get to work, but they were
> too
> sofisticated (checked for many things taht i was not concerned for, didnt
> allow
> files to be overwritten, changed directories of where the files were
> uplaoded
> to, changed the file names automatically) and many that i wasnt able to
> get to
> work.
>
> I just need something simple like the above. Unfortunately I am no
> scripter,
> so when i tried to decifer the ready made scripts and rearrange them to
> suit my
> needs, i messed things up.
>
> Thanks immensely in advance of anyone who canb offer m eany help or point
> me
> in a better direction. I wasnt sure where to post this query/help plea.
>
> Cheska
>
>
>
Murray *ACE* Guest



Reply With Quote

