Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

911 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

16 Experts available now in Live!

Get 1:1 Help Now