HI DD,
 
Best way is to post to a server scripting, i.e. PHP:
 
function MyObj(msg) { this.msg = msg }
    MyObj.prototype.operationComplete = function(urlRequestStatus)
    {
 
       //alert(this.msg+" "+status);
       //alert(this.msg+" "+urlRequestStatus);
       if(urlRequestStatus.success)
       {
         //alert('success');
 if (urlRequestStatus.content!=null)
 {
   alert(urlRequestStatus.content);
           GraphicChanged = false;
 }
       }
 
    }
 

    var fd = null;
    var filename = "NoName.svg";
    function saveFileOk(file,email,fileshort) {
      //alert(email);
      var content = glist.getSave();
      //alert(content);
      postURL("savefile.php?filename="+file+"&email="+email,content, new
MyObj("My message:"));
      //filename = fileshort;
      }
 
 
savefile.php:
 
<?php
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
 
//$filename="./user/nothing";
//input $file
//      $HTTP_RAW_POST_DATA from posturl
if(!preg_match("/.svg/",$filename)) $filename.=".svg";
//a little security
//$filename =  ereg_replace("\.\./", "",$filename);
echo ("Filename: ".$filename." ");
if(preg_match("/\.\/user\//",$filename) ||
preg_match("/\.\.\/svgeditor\/user\//",$filename)) {
    if($fp = fopen($filename,"wb+")) {
      fputs($fp,'<?xml version="1.0" encoding="iso-8859-1"?>');
      //fputs($fp,"\n<svg width=\"100%\" height=\"100%\">");
      fputs($fp,$HTTP_RAW_POST_DATA);
      //fputs($fp,"\n</svg>");
      fclose($fp);
 
      echo("File write succeded:");
      if($email != "") {
        $message = '<?xml version="1.0" encoding="iso-8859-1"?>';
        $message .= "\n<svg width=\"100%\" height=\"100%\">";
        $message .= $HTTP_RAW_POST_DATA;
        $message .= "\n</svg>";
        mail($email,"Your svg from Resource Solutions",$message,"From:
[EMAIL PROTECTED]");
        if($lfp = fopen("savelogfile.log","a+")) {
          $strout = sprintf("Email: %s IP: %s writing file %s on
%s",$email,$REMOTE_ADDR,$filename,date("d.M.Y, G:m:s", time()));
          fputs($lfp,$strout);
          fputs($lfp,"\n");
          fclose($lfp);
          }
        }
      else {
        if($lfp = fopen("savelogfile.log","a+")) {
          $strout = sprintf("IP: %s writing file %s on
%s",$REMOTE_ADDR,$filename,date("d.M.Y, G:m:s", time()));
          fputs($lfp,$strout);
          fputs($lfp,"\n");
          fclose($lfp);
          }
        }
      }
    else
      echo("File create failed:");
    }
else
  echo ("Nice try!");
?>
 
 

-----Original Message-----
From: svg-developers@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of deeti_dave
Sent: Mittwoch, 10. August 2005 23:11
To: svg-developers@yahoogroups.com
Subject: [svg-developers] how to write to a file using posturl()


Dear all,

I'm back again with question!
I am using different ways to post some data to an html page:

function display_vol(evt){
      var vol = js_arr[0];
            
      svgdoc = evt.target.ownerDocument;
      alert("before postURL()");
      var somevar = 'In SVG';
      //postURL('svgWrite.html&avol='+vol,somevar ,callback);
        //postURL("svgWrite.html?avol=",vol ,callback);
        //postURL("svgWrite.html" ,"avol="+vol ,callback);
      postURL("svgWrite.html?avol="+vol,vol ,callback);

}


function callback(obj){
      var string = '';
      if(obj.success){
            alert("success!");
            string = obj.content;
            alert(string);


      }else{
      alert("request failed !");
      }
}



I tried all the ways commented in the code above to post some data, 
but in html I can not get that value when I run this code. Plese, I 
would really appreciate it if I can get some guidance..

Thank you
DD





-----
To unsubscribe send a message to:
[EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
---- 



  _____  

YAHOO! GROUPS LINKS 


        
*        Visit your group "svg-developers
<http://groups.yahoo.com/group/svg-developers> " on the web.
  

*        To unsubscribe from this group, send an email to:
 [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
  

*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> . 


  _____  




[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h465pj1/M=362329.6886308.7839368.1510227/D=groups/S=1706030389:TM/Y=YAHOO/EXP=1123722256/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to