Solved

Write binary data to file in javascript (like image file)

Posted on 2012-03-27
7
539 Views
Last Modified: 2012-08-13
Is there a way to write binary data to local disk files in javascript like image files?

I try it but it works only for txt files:

                                    var fp = fopen('image.jpg', 3);
                                    fwrite(fp, '<?php echo $contents; ?>')
                                    fclose(fp);

Thanks in advance
Zumba
0
Comment
Question by:ZumbaJr
  • 3
7 Comments
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 37771681
In short, you cannot save a file using javascript on client side.

You need to invoke server-side script to save this on server side.
0
 

Author Comment

by:ZumbaJr
ID: 37781233
I've requested that this question be deleted for the following reason:

It's wrong
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37772282
Kindly explain the reason in detail, or I will have to object to your request.
0
 
LVL 40

Expert Comment

by:gurvinder372
ID: 37781234
saying "its wrong" and closing the question is not right. Please explain why are you closing the answer
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now