Jump to content

Recommended Posts

just like in your last post, try searching. really it's no difference if you search for images, PDF, video, etc though. the filetype is usually irrelevant if you are doing file uploads, other than just typically validating the extension. but anyway, here's what i found on google. just like your last post, but changed it to video instead of image.



and file upload in general




try something out, then let us know where you get stuck and show the code you tried.

Edited by thescientist
Link to post
Share on other sites

Notice: Undefined index: pictures in /opt/lampp/htdocs/magazine/upload.php on line 2Notice: Undefined index: pictures in /opt/lampp/htdocs/magazine/upload.php on line 3





$tmp_name =$_FILES ['pictures']['tmp_name'];
$uploadfilename = $_FILES ['pictures']['name'];
$newfilename = '/pictures/'.basename($savedate."_".$uploadfilename);
if (move_uploaded_file($tmp_name, $newfilename)){
echo "<p> file terupload</p>n";
what is problem ?
Link to post
Share on other sites

the error seems to make it pretty clear. you don't have an index in the $_FILES array called pictures. What do you get if you output $_FILES, like with var_dump? Did you give your input file element in your HTML a name of pictures?


You should really be testing for errors in the $_FILES array too.

Edited by thescientist
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...