Jump to content

a php script works in IE but not in safari .. please help


Anirban1987

Recommended Posts

The following php works in internet explorer but not in safari or chrome .

In IE all files are saved in specified folder .

But in safari , xml portion works .. that is myxml.xml is saved in 'uploads/'.$temp directory ... but uploaded files are not saved in the given folder ..instead they are saved in 'uploads' folder .... not in 'uploads/'.$temp folder or 'uploads/'.$temp.'/image/' folder ...

The script is called from flash ...

I am new to php ... please help ...

<?php
session_start();
$temp=$_SESSION['myfolder'];
$raw_xml=file_get_contents("php://input");
if(isset($_FILES['Filedata']['name'])){
$whichfile=$_FILES['Filedata']['name'];
$whichextension=substr($whichfile,-3);
if($whichextension=='flv'||$whichextension=='pdf'||$whichextension=='txt'||$whichextension=='mp3'){
move_uploaded_file($_FILES['Filedata']['tmp_name'],'uploads/'.$temp.'/'.basename($whichfile));
}
elseif($whichextension=='jpg'||$whichextension=='png'||$whichextension=='gif'){
move_uploaded_file($_FILES['Filedata']['tmp_name'],'uploads/'.$temp.'/image/'.basename($whichfile));
}
}
elseif($raw_xml!=false){
$fp=fopen('uploads/'.$temp.'/myxml.xml','w');
fwrite($fp,$raw_xml);
fclose($fp);
}
else{
echo "&fname=$temp";
}
?> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

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.