Is JAVAscript the only thing that could wrong under a html page?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Norberto Rivera

    #1

    Is JAVAscript the only thing that could wrong under a html page?

    Is there another option that allows me to do what I want to do?

    Javascript does not allow me (as far as I could see: I don't know
    much) to delete, rename, or copy a file at the web hosting side.

    Is there any trick in javascript or anything else that allows me to do
    this?

    Help.

    I am posting the question I did to various newsgroup regarding
    javascript and I received a "No, it cannot be done."

    =============== =============== ===============
    I am in a situation regarding Network Cameras.

    I am FTPing finally from my network camera to my rented web site.

    Now this situation:
    I want to display the image in my website; thus, the name of this file
    must be the same all the time (I think.).

    But the camera upload a file to a directory called "8_15_2004"
    depending of the day and the file "21_56_06GMT.JP G" depending on the
    time.

    I want to copy this upload file to a static name in order to show it
    on my webpage.

    I think I need a java script to grab this file and copy it to an
    static name; e.g., "camerapicture" . disregarding the name of the foler
    or the name of the file.

    Finally I want to delete the these files. If not the space fill up
    quite quickly.

    The problem, I see with this methods, is that files won't be delete
    when the script is not running or when no one is looking at the page.
  • Evertjan.

    #2
    Re: Is JAVAscript the only thing that could wrong under a html page?

    Norberto Rivera wrote on 19 aug 2004 in comp.lang.javas cript:[color=blue]
    > Javascript does not allow me (as far as I could see: I don't know
    > much) to delete, rename, or copy a file at the web hosting side.
    >
    > Is there any trick in javascript or anything else that allows me to do
    > this?
    >[/color]

    Sure it can be done[, but my answer probably will not help you]:

    Use serverside javascript under ASP on your hosting site.

    With clientside javascript it cannot be done.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)

    Comment

    • Norberto Rivera

      #3
      Re: Is JAVAscript the only thing that could wrong under a html page?

      The subject should read:
      Is JAVAscript the only thing that could RUN under a html page?



      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • kaeli

        #4
        Re: Is JAVAscript the only thing that could wrong under a html page?

        In article <7c28048e.04081 91142.70f66836@ posting.google. com>,
        Norberto_Rivera @yahoo.com enlightened us with...[color=blue]
        > Is there another option that allows me to do what I want to do?
        >
        > Javascript does not allow me (as far as I could see: I don't know
        > much) to delete, rename, or copy a file at the web hosting side.
        >
        > Is there any trick in javascript or anything else that allows me to do
        > this?
        >[/color]

        No.
        [color=blue]
        > Help.
        >
        > I am posting the question I did to various newsgroup regarding
        > javascript and I received a "No, it cannot be done."[/color]

        And you thought everyone was wrong? ;)

        Client-side Javascript cannot by itself talk to a server. It needs help,
        either from an applet, COM, ActiveX, or CGI script resident on the server.
        [color=blue]
        >
        > I want to copy this upload file to a static name in order to show it
        > on my webpage.
        >
        > I think I need a java script to grab this file and copy it to an
        > static name; e.g., "camerapicture" . disregarding the name of the foler
        > or the name of the file.
        >
        > Finally I want to delete the these files. If not the space fill up
        > quite quickly.
        >
        > The problem, I see with this methods, is that files won't be delete
        > when the script is not running or when no one is looking at the page.
        >[/color]

        This cannot be done with normal Javascript.
        It can be done in pretty much any other language right from your PC. A DOS
        batch job, VB, C, C++, java, perl...

        Make a program on your pc to FTP in and do those things. Just make it in
        something besides javascript. *heh*

        You can give an HTA a shot, but it would actually be using proprietary
        microsoft WSH commands in a JScript environment.

        The best way to do it, though, is with a cron (scheduled task) that actually
        runs on the server. My host supports this. Does yours? Ask.
        You could also make a program that runs on your own computer as a scheduled
        job, but that would mean your computer would actually have to be on at the
        particular time.

        --
        --
        ~kaeli~
        Any sufficiently advanced technology is indistinguishab le
        from magic.



        Comment

        • Norberto Rivera

          #5
          Re: Is JAVAscript the only thing that could wrong under a html page?


          Ok. I am starting to belive that javascript can no do this. Just
          kidding!

          Let me ask you this:
          I know I can refer to a image using a variable but could I asign to that
          variable the most recent upload image name? Forget the deletion part.

          For example ( I don't know javascript)

          Do while true()

          find the most recent *GM.jpg picture
          campicture = recent picture name
          show campicture

          repeat

          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • kaeli

            #6
            Re: Is JAVAscript the only thing that could wrong under a html page?

            In article <41251cb3$0$144 77$c397aba@news .newsgroups.ws> ,
            norberto_rivera @yahoo.com enlightened us with...[color=blue]
            >
            > Ok. I am starting to belive that javascript can no do this. Just
            > kidding!
            >
            > Let me ask you this:
            > I know I can refer to a image using a variable but could I asign to that
            > variable the most recent upload image name? Forget the deletion part.
            >[/color]

            Again, it cannot talk to the server by itself. At all. Even to get the name
            of one file. Much less being able to tell "the most recent". To tell what the
            most recent upload is, a script would have to be able to see timestamps of
            ALL files. Normal client-side JS cannot do this. Use an applet. They're not
            that hard to make and there are probably free ones on the net to interact
            with the server to get a list of files. Actually, I know there are. Google is
            your friend. *smile*

            You don't try to use COBOL to do complex math operations or make graphical
            charts from data. Don't try to use javascript for something it isn't meant to
            do. You'll just hurt your head bashing it against the wall. Computer
            languages all have their specialties and were made to do specific things.
            Trying to use one to do a task it just wasn't meant to do is asking for big
            headaches. Javascript is really great for DHTML. It is not great for
            interacting with a server from the client. Sometimes one can do workarounds
            by using a server-side script, but it's just that - a workaround.

            Your main goal was a dynamic web page built BEFORE the client sees it. That's
            what ASP/JSP/CGI and such are for. Use the right tool for the job. And get a
            host that lets you run scripts to clean up those files ON THE SERVER. Don't
            try to hammer nails into the wall with a plunger.


            --
            --
            ~kaeli~
            Synonym: the word you use in place of a word you can't
            spell.



            Comment

            Working...