Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 571
  • 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

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

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