I m facing a problem to used at below code, please help me then i can purchase this component.
http://localhost:1833/test/filename for open to server
http://localhost:1833/test/UploadAction.aspx for save to server
then file is not saved and made a tmp file but i want to replace this new doc file
i have used this code for save to server
function
SavetoServer()
{
if(document.OA1.IsOpened)
{
document.OA1.HttpInit();
var today = new Date();
var myGuid = (today.getMonth()+1).toString();
myGuid += today.getDate().toString();
myGuid += today.getYear().toString();
myGuid += today.getHours().toString();
myGuid += today.getMinutes().toString();
myGuid += today.getSeconds().toString();
var sFileName = myGuid + “.tmp”;
document.OA1.HttpAddPostOpenedFile (sFileName);
document.OA1.HttpPost(
“http://localhost:1833/test/UploadAction.aspx“);
if(document.OA1.GetErrorCode() == 0)
{
var sPath = “Save successfully! You can download it http://localhost/” + sFileName;
window.alert(sPath);
}
}
else{
window.alert(
“Please open a document firstly!”);
}
}
One Response to “HttpUpload word document to server”
Leave a Reply
You must be logged in to post a comment.
March 15th, 2008 at 6:17 pm
var sFileName = myGuid + “.tmp”;
document.OA1.HttpAddPostOpenedFile (sFileName);
Becase you have set the new file name at the post method. SFileName is a temporary file name.
If you know your file name, you can set the parameter at the HttpAddPostOpenedFile method.
For example:
document.OA1.HttpAddPostOpenedFile (“filename.docx”);
Or you can change the tmp file in your server when you receipt the file in the server.