Solved

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

Posted on 2012-03-27
7
533 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

747 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

8 Experts available now in Live!

Get 1:1 Help Now