Welcome to Dream.In.Code
Getting Help is Easy!

Join 109,372 Programmers for FREE! Ask your question and get quick answers from experts. There are 957 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Need help writting server side file from Javascript

 
Reply to this topicStart new topic

Need help writting server side file from Javascript, IE error HTTP 404 - The webpage cannot be found.

jcarrott
post 23 Jul, 2008 - 07:54 AM
Post #1


New D.I.C Head

*
Joined: 23 Jul, 2008
Posts: 5

jscript

function saveFile(strHtml) {
name = '/lawson/xhrnet/EmailStubs/' + authUser.employee + '_PayStub_' + CheckNum + '.html';
frames['emailstub'].location.href = name

open('emailstub', 'replace');
write(strHtml);
close();

if(execCommand('emailstub', false, name)) {
window.alert( name + ' has been saved.');
}
return true;
}


*****************************
Name is local variable and using "alert" I found that it contains the correct info.
The string with the HTML data I want to write to the server is in a global variable 'strHtml'.
CheckNum is also a global var.
The iframe is called 'emailstub'

*****************************

I cannot get the file to be created on the sever.
Any ideas??

Mod Edit: Please use code tags when posting your code. Code tags are used like so => code.gif

Thanks,
PsychoCoder smile.gif
User is offlineProfile CardPM

Go to the top of the page


PsychoCoder
post 23 Jul, 2008 - 07:58 AM
Post #2


DIC.Rules == true;

Group Icon
Joined: 26 Jul, 2007
Posts: 7,241



Thanked 52 times

Dream Kudos: 7775

Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, GDI, Boo.Net

My Contributions


JavaScript is a client-side language, thus it's used for client-side interaction. To create a file on a remote server you're going to need a server-side language such As PHP, ASP, ASP.NET, RoR, JSP, etc.

Moved to the JavaScript forum
User is offlineProfile CardPM

Go to the top of the page

jcarrott
post 23 Jul, 2008 - 09:18 AM
Post #3


New D.I.C Head

*
Joined: 23 Jul, 2008
Posts: 5

I understand that I need to use php. That was why I posted this in php rather than Javascript.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 9/6/08 11:30PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month