[PLUG] PHP question

Jon Jacob jon at manymoons.net
Sun May 19 03:13:41 UTC 2002


Try having the die message print out the name of the file and make sure
that looks right and that it does exist.

Still, I am sure you need the multipart/form section there.

On Sat, 2002-05-18 at 19:40, Matt Alexander wrote:
> Makes no difference.
> 
> 
> On 18 May 2002, Jon Jacob wrote:
> 
> > The form needs to have enctype="multipart/form" is my guess.
> >
> > <form method="post" action="upload.php" enctype="multipart/form">
> >
> > On Sat, 2002-05-18 at 17:28, Matt Alexander wrote:
> > > I'm trying to upload a file using PHP.
> > > Here's the main HTML file:
> > >
> > > <html>
> > > <head><title></title></head>
> > >
> > > <form method="post" action="upload.php">
> > >
> > > <input type="file" name="file">
> > > <p><input type="submit" name="submit" value="Upload">
> > >
> > > </form>
> > >
> > > </body>
> > > </html>
> > >
> > >
> > > And here's the PHP file:
> > >
> > > <?
> > > if ($file != "") {
> > > 	copy($file, "/tmp/$file_name") or die("Couldn't copy the file.");
> > > }
> > > else {
> > > 	die("No message file specified.");
> > > }
> > > ?>
> > >
> > > <html>
> > > <head><title></title></head>
> > > <body>
> > > You sent: <? echo "A $file_size byte file named $file_name
> > > with a mime type of $file_type"; ?>.
> > > </body>
> > > </html>
> > >
> > >
> > > Everytime I click the Upload button, I get "No message file specified."
> > > My php.ini says it's allowing uploads.
> > > Any ideas why this isn't working?
> > > Thanks,
> > > ~M
> > >
> > >
> > > _______________________________________________
> > > PLUG mailing list
> > > PLUG at lists.pdxlinux.org
> > > http://lists.pdxlinux.org/mailman/listinfo/plug
> >
> >
> >
> > _______________________________________________
> > PLUG mailing list
> > PLUG at lists.pdxlinux.org
> > http://lists.pdxlinux.org/mailman/listinfo/plug
> >
> 
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug






More information about the PLUG mailing list