Results 1 to 5 of 5
  1. #1

    Question Can javascripts read and write to files

    I have no knowledge in JavaScript.

    I am developing a website through which people could register for a webspace account, and then start uploading their web pages, that will be visible on the internet.

    If I allow people to upload php scripts, I know that they will be able to read and write to files and folders to which they have permission in my server.

    Similarly, if I allow people to upload JavaScript, or allow them to upload HTML pages in which there are java-scripts, will they be able to read and write, to files and folders in my server?


  2. #2
    Join Date
    Apr 2009
    Pittsburgh, Pennsylvania
    no. Javascript alone, cannot read/write to a server.

    Let me rephrase, it can read, but only through ajax.. it has to be visible in the public_html (or www in some cases, or even htdocs) for it to be able to read it.. its just another web request basically.

  3. #3
    Join Date
    Nov 2001
    As cselzer said - no.

    You'll find no mention of fopen or other file handling capabilities. You can write to a cookie file, but that's about it, and even that will require a *client* (typically a browser) running on your server to be able to write that cookie file to your server.

    If you are going to offer a public page hosting service you should really do some basic web dev tutorials so that you can better understand how everything hangs together. You can't possibly hope to manage such a system properly unless you do have a basic grasp of what others will be doing on *your* system.
    “Even those who arrange and design shrubberies are under
    considerable economic stress at this period in history.”

  4. #4
    Join Date
    Jan 2008
    St. John's, NL
    JavaScript alone cannot, as it is just a client-side language (meaning limited to the web browser itself). Used in combo with PHP or other language, it can.

    Read up
    Cpanel/WHM • PHP • Perl • Ruby • Full Time Support
    LCWSoft - Canada web hosting (based in Newfoundland) since 2007
    Servers based in the US and Canada (Uptime Report)

  5. #5
    Thanks a lot folks for the clarification :-)

    Since I am not in a hurry to somehow finish this project, I am very cautions when developing this site. Just want to make sure that I don’t allow people to damage the server, or mess with other’s data.

    I really appreciate all your help.


Similar Threads

  1. PHP - Read/write MS-Excel (Help)
    By Badie in forum Programming Discussion
    Replies: 2
    Last Post: 09-16-2006, 03:09 PM
  2. Apache cannot write to files
    By qllonceagain in forum Hosting Security and Technology
    Replies: 2
    Last Post: 06-07-2005, 06:15 AM
  3. How to write PDF Files
    By boonchuan in forum Web Design and Content
    Replies: 11
    Last Post: 10-04-2004, 04:25 PM
  4. cant write files on my computer
    By jasong in forum Web Hosting Lounge
    Replies: 0
    Last Post: 07-14-2004, 12:46 PM
  5. Anyone here read/write German?
    By I, Brian in forum Web Hosting Lounge
    Replies: 3
    Last Post: 02-12-2003, 06:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts