Jump to content

javascript hack


hvle

Recommended Posts

C:/windows/data.dat

javascript cannot access a local file, it can only access server files through ajax

 

that's true, but how can ajax access server file?  What I meant access is read/write directly to file, not post/get.

Link to comment
Share on other sites

ajax can 'call' a php file on the server using the normal ajax connection, and that php file will execute.  Now that php file can do anything php has the power to do on your web host including create and read and write files on the server using 'fopen'.

 

It is possible for the user to go to a form on your web page, select a file from his computer using the 'browse' in connection with one of those form fields, and then that file is uploaded to the server using ajax.  Your server language, like php, can then install that file anywhere you want on your web site.

 

It is not possible, however, for javascript to access and upload a file on the users home machine to the server without the users direct interaction!  Nor are you allowed to download and install anything on the clients home machine without their direct interaction like clicking on a link that then pops up an alert box asking 'run file or save file?'.  If either of those things were allowed, the security dangers on the web would literally be thousands of times greater!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.