Jump to content

File upload problem


tomkure

Recommended Posts

Hi everybody,

 

I have recently change to a new server, and have some problem with a script for uploading files on my new server.

Script is an old which I have updated with new php command, <? not accepted in new server.

 

Scripts shall upload picture to folder in server and write information to database

 

From form script I am saving my upload

 

<input type="hidden" name="Mode" value="EditMapProperty" />
<input type="hidden" name="Old_Map" value="<?php echo $Property->Get_Map();?>" />

 

In my php script I do

 

elseif($Mode=="EditMapProperty"):

  $Map_name = $HTTP_POST_FILES['Map']['name'];

  $Property=new Property($PropertyID);

  $ReferenceNo=$Property->Get_ReferenceNo();

  if($Map!=""): $DeleteMap=$Dir_MapProperty_Admin."".$Property->Get_Map();  @unlink($DeleteMap); endif;

  if($Map_name==""):

    $Map=$Old_Map;

  else:

    copy($HTTP_POST_FILES['Map']['tmp_name'],

    $Dir_MapProperty_Admin."".$ReferenceNo."-".$Map_name);

    $Map=$ReferenceNo."-".$Map_name;

  endif;

 

  $Property->EditMap($Map);  //Update database information

         

  echo "<meta http-equiv=\"refresh\" content=\"0;URL=$Redirect2?p=property_details&PropertyID=$PropertyID\">"; 

 

Can any help if there are any PHP problem in this coding.

 

Kind Regards

Tom

Link to comment
https://forums.phpfreaks.com/topic/251826-file-upload-problem/
Share on other sites

The forum's menu button you used to highlight your php code is for making links to the php manual section for php keywords. Just use the forum's


bbcode tags for php code.

 

$HTTP_POST_FILES was depreciated a really long time ago, turned off by default in php5.0, finally throws a depreciated error in php5.3, and is completely removed in php5.4. Use $_FILES instead of $HTTP_POST_FILES

 

Link to comment
https://forums.phpfreaks.com/topic/251826-file-upload-problem/#findComment-1291304
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.