|
My web Application is does a lot of disk processing on the server, i.e. copying files, saving files, changing files, etc. All this is done at the server, say, at the C drive. My question, what kind off security access must I use to do all this?
I ask this because my web app sometimes throws me an error saying "Access is denied" for some files and not for others. Any pointers would be appreciated!
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
Does anyone know of any client side Javascript code for creating GUIDs?
PS I know it's a long shot, but I'm cluthing at any and all straws at the moment
Thanks
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
I recall reading about GUID generation a while back and it disscussing how it works:
1) Uses the machines unique network card ID
2) system data and time
3) and a few other variables
This is how i remember it.
Anyways, I don't think it would be possible for Javascript to obtain any variable/values like the above, except Date, time, screen res, etc...
So I would guess, your best bet would be to mimic GUIDs by generating a 128 bit string maybe of random generated characters using the mersenne twister algorithm or something or whatever jscript uses for rnd or rand or whatever.
Cheers
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Hockey wrote:
Anyways, I don't think it would be possible for Javascript to obtain any variable/values like the above, except Date, time, screen res, etc...
Yeah, that's why I was skeptical as to how "unique" a home made javascript GUID actually would be.
I suppose for my purposes I could come up with something unique enough.
Hey thanks Hockey for your help with this and my other post. As you can tell, I'm really not much of a web developer at all I'm kind of filling in temporarily so I'm a deer caught in the headlights at the moment.
Thanks again
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
Senkwe Chanda wrote:
As you can tell, I'm really not much of a web developer at all I'm kind of filling in temporarily so I'm a deer caught in the headlights at the moment.
Thats how it started with me too
Cheers
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
I don't this will work in JavaScript, but it certainly works in Java and might be useful to some people out there (this is obviously part of a class):
import java.util.*;
import java.net.*;
import java.security.*;
private SecureRandom m_secureRandom;
private String m_strIP;
{
m_secureRandom = new SecureRandom();
try
{
m_strIP = InetAddress.getLocalHost().toString();
}
catch (UnknownHostException e)
{
}
}
private String GenerateGUID()
{
try
{
StringBuffer sGUID = new StringBuffer();
StringBuffer sRaw = new StringBuffer();
MessageDigest md5 = MessageDigest.getInstance("MD5");
long time = System.currentTimeMillis();
long rand = m_secureRandom.nextLong();
sRaw.append(m_strIP);
sRaw.append(".");
sRaw.append(Long.toString(time));
sRaw.append(".");
sRaw.append(Long.toString(rand));
md5.update(sRaw.toString().getBytes());
byte[] raw = md5.digest();
for (int i = 0; i < raw.length; i++)
{
int x = raw[i] & 0xff;
if (x < 0x10) sGUID.append('0');
sGUID.append(Integer.toHexString(x));
}
return sGUID.toString().toUpperCase();
}
catch (Exception e)
{
e.printStackTrace();
}
return "";
}
I use the above with great success DUnno how to impl. in JavaSCript, though.
|
|
|
|
|
Thanks alot But it looks like there are a few method calls there that would not be available under javascript. Still, it gives me a few ideas.
Thanks!!
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
I've had the same problem. The workaround that I took was to obtain the guid from a seperate page that is loaded on request into a hidden iframe. When that page loads it returns the GUID to the parent page (the page the iframe is contained in). Call GetGUID() to get a guid. When the page is first loaded we get an initial guid by loading the hidden frame which then calls GUIDGenerated when it loads. When we use a new guid the code loads a new guid for use next time by changing the location of the hidden frame.
HOST PAGE:
var LastCreatedGUID;
function GetGUID()
{
var CurrentGUID = LastCreatedUID;
document.frames["fraHidden"].location.replace("GUIDGenerator.asp");
return CurrentGUID;
}
function GUIDGenerated(GUID)
{
LastCreatedGUID = GUID;
}
function GetFirstGUID()
{
document.frames["fraHidden"].location.replace("GUIDGenerator.asp");
}
GUIDGenerator.asp:
<%@ Language=VBScript %>
<%
Dim GUID : GUID = server.createobject("scriptlet.typelib").guid
%>
If you're not using asp use any dynamically created page to get the guid in a similar way.
Hope this helps. Jim
Jim
|
|
|
|
|
When I choose an item from a dropdown combo box and choose the “Print” icon in my web application (cgi and perl), I expect the print preview screen of data corresponding to the chosen item from the dropdown. But I am getting the print preview of data corresponding to a “default” item from the listbox. This problem persists both in IE and Netscape. I reckon this is a cache problem. Please help.
This is Aiyappa Pasura
|
|
|
|
|
I'm developing a web based application using ASP, Perl, and DHTML and am wondering if there is any way to tinker with a clients browser settings. I really just want to force a certain print job to come out in landscape with the "Print background colors and images" set to on. This application is internal so I know that the browsers are going to be IE 5, 5.5, or 6.
Has anyone ever done anything like this.
|
|
|
|
|
Simple answer is; No.
I can't remember where I read it but unless you resort to ActiveX controls Microsoft have specifically blocked any access to the browser application from client side code. I got very annoyed but I suspect it is a good decision of theirs for security reasons.
Seeing as your app will be internal, you could possibly use an ActiveX control to do what you want. Never done it myself though so I cannot help you further than that.
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Shog9:
Paul "The human happy pill" Watson
|
|
|
|
|
Remember, though, that:
>you won't always be working with IE
>you won't always be working with Windows
Just ignore this if it doesn't apply to your situation.
"Do unto others as you would have them do unto you." - Jesus
"An eye for an eye only makes the whole world blind." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
>you won't always be working with IE
>you won't always be working with Windows
Just ignore this if it doesn't apply to your situation
jdunlap, you are preaching to the converted
Paul Watson Bluegrass Cape Town, South Africa
Macbeth muttered:
I am in blood / Stepped in so far, that should I wade no more, / Returning were as tedious as go o'er
Shog9:
Paul "The human happy pill" Watson
|
|
|
|
|
I have a class dll which provides a transparent access to the database, which I have referenced to my web application. The question I wanted to ask was, should I have an instance of the class on every form that uses it, or one instance which is defined in Global.asax which can be used in every form?
Is there any advantages of using one way over the other?
Notorious SMC
The difference between the almost-right word & the right word is a really large matter - it's the difference between the lightning bug and the Lightning
Mark Twain
Get your facts first, and then you can distort them as much as you please
Mark Twain
|
|
|
|
|
I am having trouble implementing wSpell into .asp. Any help would be greatly appreciated. Thank you.
|
|
|
|
|
Hi I'm a university student developing an applicliction in VB that dynamically adds content to a HTML page, the following is an snippit from my code:
Set SelRange = doc.selection.createRange
SelRange.pasteHTML "<span id='EXT_START'><!-- Comment --><b>" & SelHTML & "</b></span>"
SelRange.collapse True
H_HTML = doc.body.innerHTML
WriteHTMLtoFile H_HTML
The problem is that the comment is not added to the HTML ... Why is this? and is there any way to add a Comment? Thanks
|
|
|
|
|
I need to have a small popup appear when the user hovers the mouse over a certain part of an image. I actually need several different popups - one for each region of the image.
Is this possible? Can someone point me in the right direction?
J
"You can get anything you want at Alice's Restaurant."
|
|
|
|
|
It wouldn't be that difficult to have a popup display itself if your regions are square or rectangle. Polygons would require a more advanced algorithm for determining whether the mouse is within the region. However you could probably find C++ code for that algorithm somewhere even on CP maybe and just simply port it to Javascript.
So this would be your first steps:
1) Determine if you image regions required are polygonal or square/rects
2) Search for algorithm for determing whether a point is within an irregular region or polygon or seomthing to that effect.
3) Create your popups dynamically using innerHTML or hardcode them into your HTML.
4) Show and hide your popups using DOM's 'visibility' or 'display'
Have fun.
Cheers!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Hi guys, is it possible to send an http post from a client to a server machine using javascript?
For example how can I send a post containing some querystring back to the server from the clients browser?
Thanks!!
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
I believe if you want any data sent to a CGI script via POST you must encapsulate your form data with form tags. There is a submit() which could be called to programmatically send data to a script on the server, instead of having the user click Submit button. There may be a hack around this i'm not sure off the top of my head, i'd have to think about it for a while.
If sending data to the server doesn't require POST you can use GET method and send some data to a script on the server whether it be stored in a variable or cookie.
var temp = getCookie('my_cookie', document.cookie);
for(var i=0; i<12; i++){
if(temp==i)
location.href="index.php?my_value="+temp;
}
What exactly is it your trying to accomplish??? Maybe i can figure something out for you.
Cheers!
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
Well interestingly enough I'm trying to retrieve cookie values and have them sent out to a server as part of a query string. Problem is, I don't know javascript and don't really want to have to learn it. I assumed that there would be similar code snippets out there that I could use but the ones I've seen look hackish. By the way, I want to read the whole cookie, not just specific values.
The method you've shown above though, with "location.href", does that use POST under the covers?
Thanks!
Senkwe
What's the difference between a C++ programmer and God? God knows he's not a C++ programmer :
anon
|
|
|
|
|
Senkwe Chanda wrote:
The method you've shown above though, with "location.href", does that use POST under the covers?
No i'm pretty sure it's GET because the values would be part of the URL.
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
You can use forms , and submit using Javascript.
What you are sending is accessible from server side.
|
|
|
|
|
Hi,
I'm looking for a web site like code project, but for web desing ( CSS's, java script goodies, ...).
Can you tell me one cool site ?
Thanks
|
|
|
|
|
I know a site that isn't as diverse as here but does give some excellent examples of what can be achieved with Javascript and CSS. It's the best web site interface I've ever seen.
www.youngpup.net[^]
Live to ride. Ride to live.
|
|
|
|