File upload issues


Posted on 16th Feb 2014 07:03 pm by admin

Hi Guys,

Can anyone see any issues with this code:
Code: $setImage= 'productimages/' . date(U) . $HTTP_POST_FILES['setImage']['name'][0];
copy($HTTP_POST_FILES['setImage']['tmp_name'][0], $setImage);
Its stripping the original file name (including the extension) fromt he end of the image and just giving it a unix timestamp for a name. Looking at the code I think I can see why its doing that but I can't see how to fix it.

Any help would be most appreciated

No comments posted yet

Your Answer:

Login to answer
152 Like 32 Dislike
Previous forums Next forums
Other forums

array_diff weirdness
I'm using the following bit of code

$diff = array_diff($pids, $pidlist);
$diff = array_va

Help Ordering Arrays
Hi, I have 3 arrays as shown below.

Code: $users = $this->get_latest_users();
$flir

Limiting uploaded file type
Hi. First post here
I am working on a simple upload script, and I need it to limit the allowed f

in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)

Examp

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Must-Know Topics of PHP
Can you guys list the must-know topics of PHP. I am still a learner and I am trying to cover most of

preg_match logical error
Code: <?php
$s = file_get_contents("page.html");
preg_match('/<div cla

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash