473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.JPG" 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.
Jul 23 '05 #1
5 1148
Norberto Rivera wrote on 19 aug 2004 in comp.lang.javascript:
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?


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)
Jul 23 '05 #2
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!
Jul 23 '05 #3
In article <7c**************************@posting.google.com >,
No*************@yahoo.com enlightened us with...
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?

No.
Help.

I am posting the question I did to various newsgroup regarding
javascript and I received a "No, it cannot be done."
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.

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.


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 indistinguishable
from magic.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #4

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!
Jul 23 '05 #5
In article <41**********************@news.newsgroups.ws>,
no*************@yahoo.com enlightened us with...

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.


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.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Kai Grossjohann | last post by:
It seems that Ctrl-N in Mozilla opens a new empty browser window. That's fine, I don't need to do anything about it. But Ctrl-N in IE appears to clone the current window. Is there a way to...
53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
15
by: binnyva | last post by:
Hello Everyone, I have just compleated a JavaScript tutorial and publishing the draft(or the beta version, as I like to call it) for review. This is not open to public yet. The Tutorial is...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
2
by: Jake Barnes | last post by:
Using javascript closures to create singletons to ensure the survival of a reference to an HTML block when removeChild() may remove the last reference to the block and thus destory the block is...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
8
by: Taras_96 | last post by:
Hi everyone, We' ve come to the conclusion that we wish the user to be directed to an error page if javascript is disabled <enter comment about how a webpage shouldn't rely on javascript here :)...
16
by: Phlip | last post by:
Javascripters: I have a page with an iframe inside. Let's say the iframe looks like this: <script src="/javascripts/prototype.js" type="text/javascript" /> .... <iframe id='grinder'...
22
by: Dan Rumney | last post by:
Hi all, I've been writing Javascript for quite a while now and have, of late, been writing quite a lot of AJAX and AJAX-related code. In the main, my dynamically generated pages are created...
19
by: maya | last post by:
hi, so what is "modern" javascript?? the same as "DOM-scripting"? i.e., editing content (or changing appearance of content) dynamically by massaging javascript objects, html elements, etc? ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.