Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 574
  • Last Modified:

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

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
ZumbaJr
Asked:
ZumbaJr
  • 3
1 Solution
 
Gurvinder Pal SinghCommented:
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
 
ZumbaJrAuthor Commented:
I've requested that this question be deleted for the following reason:

It's wrong
0
 
Gurvinder Pal SinghCommented:
Kindly explain the reason in detail, or I will have to object to your request.
0
 
Gurvinder Pal SinghCommented:
saying "its wrong" and closing the question is not right. Please explain why are you closing the answer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now