Article View: aus.computers.java
Article #745Re: FTP integrated updating script
From: sydneyshan
Date: Wed, 07 Jun 2000 00:00
Date: Wed, 07 Jun 2000 00:00
146 lines
6764 bytes
6764 bytes
Damn. Thanks for your help Alan. I've got a backup plan to get it sorted out
(will host on a Lotus Notes Domino server, allowing the user to update
everything using their Lotus Notes intranet.)
Looks like Java is a bit of a fizzer when it comes to FTP.
Thanks again,
Shannon Murdoch
-Sydney
Alan Boldock wrote:
> The JavaScript is very primitive. Its essentially
>
> function NewPage()
>
> var passname=document.myform.tit.value
> var passage=document.myform.hed.value
> var passbody=document.myform.bod.value
>
> myWin = window.open ("about:blank", "myWin");
> myWin.document.open ();
> myWin.document.write ("<html><head>");
> myWin.document.write ("<meta name='created by'
> content='Web Page Maker'>");
> myWin.document.write ("<meta name='Version'
> content='version 1.0'>");
> myWin.document.write ("<meta name='where can i get
> web page maker'
>
> content='http://www.baillie951.freeserve.co.uk/WPMaker - Its free'>");
> myWin.document.write ("<title>" + passname +
> "</title>");
> myWin.document.write (""+ passage +"");
> myWin.document.write ("" + passbody + "");
> myWin.document.write ("</body></html>");
>
> }
>
> and it doesn't upload a thing.
>
> you could make this a lot more sophisticated and to include your HTML. But
> as
> stated before your problem is the upload.
>
> As for the other site all it does is for a URL to connect to an FTP site
> again it does no upload. I've looked in my "O'Reilly: JavaScript the
> Definitive Guide"
> and can't see any way of doing an FTP upload in JS but I could be wrong.
>
> Alan Boldock
> alan@boldenterprise.com.au
>
> "sydneyshan" <sydneyshan@hotmail.com> wrote in message
> news:393DA3C8.B324588C@hotmail.com...
> > Yeah I was afraid that CGI/Perl etc would need to be involved.
> > Have a look at
> http://www.baillie951.freeserve.co.uk/WPMaker/Direct/Index.htm
> > he has been able to create a 'webpage' from java and html source. I don't
> > think he has any FTP commands there though.
> > If his script could be adapted to include uploading the page to an FTP
> server
> > instead of displaying it, I think it would work. I am unclear about
> Java's
> > functionality in relation to FTP uploading/interfacing.
> >
> > Also, have a look at
> > http://www.crosswinds.net/~shannonmurdoch/ftpscriptjava.html
> > for a little bit of java/FTP integration.
> >
> > If you could some how merge these two scripts so that the page is uploaded
> > instead of displayed, it would work perfectly!
> >
> > Can it be done?
> >
> >
> > Alan Boldock wrote:
> >
> > > Perhaps you shouldn't be looking at JavaScript as that runs in the
> > > browser on the client side of the process, rather you need to look at
> > > some way of getting the file up to the site, this really needs to
> > > be done using Server side processing. There are many ways of
> > > doing this. You would use some kind of processing of
> > > the form this could be using a CGI scripting language
> > > (e.g. Perl, PHP, Python etc) or you could go to the "Dark Side"
> > > and use Active Server Pages (ASP). The preferred
> > > solution for this Newsgroup would be some serverside Java
> > > i.e. a Java Servlet or Java Server Pages (JSP) (which becomes a Servlet)
> you
> > > could get the form to submit to the Servile that knows the HTML
> > > file that the field is to be merged into and the code could do that. The
> > > code wouldn't be too hard write.
> > >
> > > The biggest problem you have is that you probably don't have
> > > an application server (that the servlets run it) so you may need to look
> > > at some other CGI approach.
> > >
> > > If your deploying onto an Hosting Service you need to check with them
> as to
> > > what they provide. In my Experience most provide some kind of Perl CGI's
> > > but many won't allow you to write your own
> > >
> > > Perhaps another approach is getting the users to edit a file on their
> > > machine
> > > that is then uploaded (FTP) to the server. That way getting around the
> form
> > > submission/processing problem.
> > >
> > > Another alternative is use Lotus/Domino its made for that sort of thing
> :-)
> > >
> > > Alan Boldock
> > > alan@boldenterprise.com.au
> > >
> > > "sydneyshan" <sydneyshan@hotmail.com> wrote in message
> > > news:393CE68B.696168B1@hotmail.com...
> > > >
> > > > Hi all,
> > > >
> > > > I'm designing a web site for a client and have run in
> > > > to the need to integrate some java into it for easy
> > > > maintainance.
> > > >
> > > > Basically, on the website (as usual, source files will be accessable
> > > > through
> > > > passworded FTP), there will be a standard HTML page with
> > > > images, tables, links AND "Hot News" on it.
> > > >
> > > > The Hot News table is the trouble area, as I don't want the
> > > > client to have to get in to updating it via an HTML editor and
> > > > FTP client, but using an on-site Javascript to do so.
> > > >
> > > > This means the client will type (or paste) the latest news in
> > > > to a field (or java-generated text dialog) and click "Update".
> > > > From here, the javascript will upload a rendition of the
> > > > existing HTML document with the new Hot News, replacing
> > > > the previous document on the FTP site.
> > > >
> > > > Is this possible using Java/Javascript?
> > > >
> > > > If so, how would you go about it?
> > > >
> > > > Thanks in advance!
> > > > -Shannon Murdoch
> > > >
> >
Technical Details
Message-ID:
<393E4E3E.F00A8AF1@hotmail.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<393CE68B.696168B1@hotmail.com> <s56%4.10173$N4.365860@ozemail.com.au> <393DA3C8.B324588C@hotmail.com> <gIo%4.10654$N4.387333@ozemail.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,2d025cff1d6bbb4 X-Google-Attributes: gid10d6db,public From: sydneyshan <sydneyshan@hotmail.com> Subject: Re: FTP integrated updating script Date: 2000/06/07 Message-ID: <393E4E3E.F00A8AF1@hotmail.com> X-Deja-AN: 632162508 Content-Transfer-Encoding: 7bit References: <393CE68B.696168B1@hotmail.com> <s56%4.10173$N4.365860@ozemail.com.au> <393DA3C8.B324588C@hotmail.com> <gIo%4.10654$N4.387333@ozemail.com.au> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353" X-Complaints-To: news@bigpond.net.au X-Trace: news-server.bigpond.net.au 960384866 144.132.190.192 (Wed, 07 Jun 2000 23:34:26 EST) Organization: Shans Homepage MIME-Version: 1.0 Reply-To: sydneyshan@hotmail.com NNTP-Posting-Date: Wed, 07 Jun 2000 23:34:26 EST Newsgroups: aus.computers.java