?
Solved

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

Posted on 2012-03-27
7
Medium Priority
?
564 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 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:Gurvinder Pal Singh
ID: 37772282
Kindly explain the reason in detail, or I will have to object to your request.
0
 
LVL 40

Expert Comment

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

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
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…
Suggested Courses

765 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