Em Andamento

Update Image upload routines php4 to php5

This is simple job I have all the code changes (see below) required to fix a broken upload routine on websites moved from php4 to php5. Its a matter of going through all the code and changing.

Please keep cost down I am on limited budget!!!

There are 13 websites that require updating all written by same developer with same routines.

Once one is done same files will transport over to the other 12.

Just check if any extra routines were written. I think the entire job will take 6 to 10 hours, I can do it myself but too busy and I am not a expert in php so easy for me to mess up.

I will give ssh access to make changes easy and fast for u, Just tar the html folder first and carry on

50% of the changes were done on one website, the guy I hired is too busy to finish as has to go to an event for his current company.

=== HTML ===

<form action='[url removed, login to view]' method=POST ENCTYPE='multipart/form-data'


<input type=file name=image size=50>

=== /HTML ===

In PHP/FI, and supported as compatibility in all of PHP3, and certain

cases for PHP4, the above would result in a global variable called

'$image' being created, containing the path to a temporary local copy of

the file on the server.

In PHP4, a safer way to deal with file uploads was introduced, the

$_FILES nested associative array.

The HTML above now results in the following structure:

$_FILES = Array


[image] => Array


[name] => "filename.jpg" (original name from user)

[type] => "image/jpeg" (original file type)

[tmp_name] => "/tmp/php...." (path for temp local copy)

[error] => UPLOAD_ERR_OK (=0)

[size] => xxx (size in bytes)



Also, if your ORIGINAL variable names contain an array index like:

<input type=file name=image[0] size=50>

<input type=file name=image[1] size=50>

Then there is one more level of nesting at the bottom:

$_FILES = Array


[image] => Array


[name] => Array


[0] => "filename1.jpg"

[1] => "filename2.jpg"


(same for the other keys)



So in the upgrade work, you need to follow a process similar to the


0. Make a backup of the file before you edit it.

1. Identify all FORMS that allow uploading.

2. Trace what PHP files those forms submit to

(NOT the pages that generate them).

e.g.: [url removed, login to view] from the above HTML.

3. Identify the variables/form inputs that contain upload files.

(Look for <input> elements with "type=file".)

4. Trace the variable names in the target scripts.

("name=image" in the example above).

4.1. The may be trivial, such as '$image', but the variables MAY also be

constructed with eval, or a string lookup in the _GLOBALS array.

(see examples below)

4.2. If you see OTHER usage of file type, size and original name, watch

out too!

5. Before first usage or creation of the variable setup, convert the

code to the new style by taking the variable name, say 'FOO', and


$FOO = $_FILES['FOO']['tmp_name'];


$FOO[0] = $_FILES['FOO']['tmp_name'][0];

(the latter case for the array index discussion above).

5.1. Similar fixes for other parts of the _FILES array.

Below are examples of the different kinds of usage I've seen thus far in your

codebase while simply fixing it for you. It wouldn't surprise me if there are

other variants as well.

Example of the GLOBALS usage, from [url removed, login to view]:



$filename = $GLOBALS[$fname];



$filename5 = $_GLOBALS[$fname];




$filename = $_FILES['userfile']['tmp_name'];


$filename5 = $_FILES['image']['tmp_name'];


Example of nested usage, from [url removed, login to view]:


$filename = $image[$i];




$filename = $_FILES['image']['tmp_name'][$i];


Example of eval() usage AND other variables, from [url removed, login to view]:


$index = array("file", "name", "size", "type");

for($i = 0; $i < 4; $i++) {

$file_var = '$' . $filename . (($index[$i] != "file") ? "_" . $index[$i] : "");

eval('global ' . $file_var . ';');

eval('$this->file[$index[$i]] = ' . $file_var . ';');





$this->file["file"] = $_FILES[$filename]['tmp_name'];

$this->file["name"] = $_FILES[$filename]['name'];

$this->file["type"] = $_FILES[$filename]['type'];

$this->file["size"] = $_FILES[$filename]['size'];


Habilidades: Linux, PHP

Veja mais: php5 image upload, image validate upload php5, php4 upload, what is multipart form-data, what is a temp, website down for me fix, watch-it-now, up string, temp work, temporary job, target solutions, string in data structure, string data structure, require a html 5 website developer, process data structure, php string to html, php5.0, one more level, new hired, kinds of data structure, keep busy, index data structure, image websites, hired out, fixing websites

Acerca do Empregador:
( 14 comentários ) Maple Ridge, Canada

ID do Projeto: #602259

9 freelancers estão ofertando em média $51 para esse trabalho


Pls see the PMB

$40 USD em 1 dia
(39 Comentários)

Hello! I am experience PHP Developer. I can do this job with quality and within the deadlines. If you check my feedbacks you will beleive in me. Thank you!

$75 USD in 2 dias
(58 Comentários)

I am well expert in PHP, MYSQL. I am confident that I can do this project. I have done several project on uploading image in image gallery. So please reply. Thanks

$55 USD in 2 dias
(7 Comentários)

Hi, I can do it efficiently within timeline. Lets Start. Thanks

$60 USD em 1 dia
(14 Comentários)

Hi, we can start right away, it will be done in a few hours.

$30 USD in 0 dias
(2 Comentários)

Greetings! We, at V I Services, have been delivering Remote IT infrastructure Management (RIM) Services successfully to clients across the globe. Our experienced Windows and Linux Support team members with the su Mais

$75 USD in 3 dias
(5 Comentários)

please see pmb for more.

$50 USD in 0 dias
(7 Comentários)

Please check you pmb. Regards

$40 USD in 0 dias
(1 Comentário)

Hi please See pm Thank you

$30 USD em 1 dia
(0 Comentários)