-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
839 lines (781 loc) · 47.3 KB
/
index.html
File metadata and controls
839 lines (781 loc) · 47.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>droidscript.io CloudStore</title>
<style media="screen">
.highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight .gh {
color: #999999;
}
.highlight .sr {
color: #f6aa11;
}
.highlight .go {
color: #888888;
}
.highlight .gp {
color: #555555;
}
.highlight .gs {
}
.highlight .gu {
color: #aaaaaa;
}
.highlight .nb {
color: #f6aa11;
}
.highlight .cm {
color: #75715e;
}
.highlight .cp {
color: #75715e;
}
.highlight .c1 {
color: #75715e;
}
.highlight .cs {
color: #75715e;
}
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cpf {
color: #75715e;
}
.highlight .err {
color: #960050;
}
.highlight .gr {
color: #960050;
}
.highlight .gt {
color: #960050;
}
.highlight .gd {
color: #49483e;
}
.highlight .gi {
color: #49483e;
}
.highlight .ge {
color: #49483e;
}
.highlight .kc {
color: #66d9ef;
}
.highlight .kd {
color: #66d9ef;
}
.highlight .kr {
color: #66d9ef;
}
.highlight .no {
color: #66d9ef;
}
.highlight .kt {
color: #66d9ef;
}
.highlight .mf {
color: #ae81ff;
}
.highlight .mh {
color: #ae81ff;
}
.highlight .il {
color: #ae81ff;
}
.highlight .mi {
color: #ae81ff;
}
.highlight .mo {
color: #ae81ff;
}
.highlight .m, .highlight .mb, .highlight .mx {
color: #ae81ff;
}
.highlight .sc {
color: #ae81ff;
}
.highlight .se {
color: #ae81ff;
}
.highlight .ss {
color: #ae81ff;
}
.highlight .sd {
color: #e6db74;
}
.highlight .s2 {
color: #e6db74;
}
.highlight .sb {
color: #e6db74;
}
.highlight .sh {
color: #e6db74;
}
.highlight .si {
color: #e6db74;
}
.highlight .sx {
color: #e6db74;
}
.highlight .s1 {
color: #e6db74;
}
.highlight .s, .highlight .sa, .highlight .dl {
color: #e6db74;
}
.highlight .na {
color: #a6e22e;
}
.highlight .nc {
color: #a6e22e;
}
.highlight .nd {
color: #a6e22e;
}
.highlight .ne {
color: #a6e22e;
}
.highlight .nf, .highlight .fm {
color: #a6e22e;
}
.highlight .vc {
color: #ffffff;
}
.highlight .nn {
color: #ffffff;
}
.highlight .ni {
color: #ffffff;
}
.highlight .bp {
color: #ffffff;
}
.highlight .vg {
color: #ffffff;
}
.highlight .vi {
color: #ffffff;
}
.highlight .nv, .highlight .vm {
color: #ffffff;
}
.highlight .w {
color: #ffffff;
}
.highlight {
color: #ffffff;
}
.highlight .n, .highlight .py, .highlight .nx {
color: #ffffff;
}
.highlight .nl {
color: #f92672;
}
.highlight .ow {
color: #f92672;
}
.highlight .nt {
color: #f92672;
}
.highlight .k, .highlight .kv {
color: #f92672;
}
.highlight .kn {
color: #f92672;
}
.highlight .kp {
color: #f92672;
}
.highlight .o {
color: #f92672;
}
</style>
<style media="print">
* {
-webkit-transition:none!important;
transition:none!important;
}
.highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight, .highlight .w {
color: #586e75;
}
.highlight .err {
color: #002b36;
background-color: #dc322f;
}
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs {
color: #657b83;
}
.highlight .cp {
color: #b58900;
}
.highlight .nt {
color: #b58900;
}
.highlight .o, .highlight .ow {
color: #93a1a1;
}
.highlight .p, .highlight .pi {
color: #93a1a1;
}
.highlight .gi {
color: #859900;
}
.highlight .gd {
color: #dc322f;
}
.highlight .gh {
color: #268bd2;
background-color: #002b36;
font-weight: bold;
}
.highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv {
color: #6c71c4;
}
.highlight .kc {
color: #cb4b16;
}
.highlight .kt {
color: #cb4b16;
}
.highlight .kd {
color: #cb4b16;
}
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 {
color: #859900;
}
.highlight .sr {
color: #2aa198;
}
.highlight .si {
color: #d33682;
}
.highlight .se {
color: #d33682;
}
.highlight .nn {
color: #b58900;
}
.highlight .nc {
color: #b58900;
}
.highlight .no {
color: #b58900;
}
.highlight .na {
color: #268bd2;
}
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
color: #859900;
}
.highlight .ss {
color: #859900;
}
</style>
<link href="stylesheets/screen-de1c7ad8.css" rel="stylesheet" media="screen" />
<link href="stylesheets/print-953e3353.css" rel="stylesheet" media="print" />
<script src="javascripts/all-7e253337.js"></script>
<script>
$(function() { setupCodeCopy(); });
</script>
</head>
<body class="index" data-languages="["javascript"]">
<a href="#" id="nav-button">
<span>
NAV
<img src="images/navbar-cad8cdcb.png" alt="" />
</span>
</a>
<div class="toc-wrapper">
<img src="images/logo-bd503ead.png" class="logo" alt="" />
<div class="lang-selector">
<a href="#" data-language-name="javascript">javascript</a>
</div>
<div class="search">
<input type="text" class="search" id="input-search" placeholder="Search">
</div>
<ul class="search-results"></ul>
<ul id="toc" class="toc-list-h1">
<li>
<a href="#overview" class="toc-h1 toc-link" data-title="Overview">Overview</a>
<ul class="toc-list-h2">
<li>
<a href="#including-cloudstore" class="toc-h2 toc-link" data-title="Including CloudStore">Initializing CloudStore</a>
</li>
</ul>
</li>
<li>
<a href="#data" class="toc-h1 toc-link" data-title="Data">Data</a>
<ul class="toc-list-h2">
<li>
<a href="#saving-data" class="toc-h2 toc-link" data-title="Saving data">Saving data</a>
</li>
<li>
<a href="#loading-data" class="toc-h2 toc-link" data-title="Loading data">Loading data</a>
</li>
<li>
<a href="#merging-data" class="toc-h2 toc-link" data-title="Merging data">Merging data</a>
</li>
<li>
<a href="#listing-data-files" class="toc-h2 toc-link" data-title="Listing Data Files">Listing Data Files</a>
</li>
<li>
<a href="#deleting-data" class="toc-h2 toc-link" data-title="Deleting data">Deleting data</a>
</li>
<li>
<a href="#password-protection" class="toc-h2 toc-link" data-title="Password Protection">Password Protection</a>
</li>
</ul>
</li>
<li>
<a href="#media" class="toc-h1 toc-link" data-title="Media">Media</a>
<ul class="toc-list-h2">
<li>
<a href="#upload" class="toc-h2 toc-link" data-title="Upload">Upload</a>
</li>
<li>
<a href="#file-location" class="toc-h2 toc-link" data-title="File Location">File Location</a>
</li>
<li>
<a href="#password-protection-2" class="toc-h2 toc-link" data-title="Password Protection">Password Protection</a>
</li>
</ul>
</li>
<li>
<a href="#dashboard" class="toc-h1 toc-link" data-title="Dashboard">Dashboard</a>
<ul class="toc-list-h2">
<li>
<a href="#loading" class="toc-h2 toc-link" data-title="Loading">Loading</a>
</li>
<li>
<a href="#user-info" class="toc-h2 toc-link" data-title="User Info">User Info</a>
</li>
<li>
<a href="#data-files" class="toc-h2 toc-link" data-title="Data Files">Data Files</a>
</li>
<li>
<a href="#media-files" class="toc-h2 toc-link" data-title="Media Files">Media Files</a>
</li>
</ul>
</li>
</ul>
<ul class="toc-footer">
</ul>
</div>
<div class="page-wrapper">
<div class="dark-box"></div>
<div class="content">
<h1 id='overview'>Overview</h1>
<div id="img-overview"><img src="images/enjine_io_architecture-5955c480.png" alt="" /></div>
<p>CloudStore makes it possible to</p>
<ul>
<li>Save data and media files to a secure online location</li>
<li>Keep your data persistent across devices and apps</li>
<li>Keep your data safe with password protection and unguessable file paths</li>
</ul>
<blockquote>
<aside class="notice-right">CloudStore uses unique API keys to allow access to the CloudStore service.</aside>
</blockquote>
<h2 id='including-cloudstore'>Initializing CloudStore</h2>
<p>Before you can use CloudStore in your project you need to initialize it like this:
<div class="highlight"><pre class="highlight javascript tab-javascript"><code>const cloud = app.CreateCloudStore( key, server, options )</code></pre></div>
</p>
<h3 id='query-parameters'>Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>key</td>
<td>yes</td>
<td>A string id to identify the data to store. This value is case sensitive.</td>
</tr>
<tr>
<td>server</td>
<td>no</td>
<td>The name of the server. You can send null as the value.</td>
</tr>
<tr>
<td>options</td>
<td>no</td>
<td>The options parameter is an object where you can pass global passwords for accessing either the Data files or Media files in the cloudstore. The passwords must be set in the <strong>CloudStore dashboard</strong>.</td>
</tr>
</tbody></table>
<p>Below is an example:</p>
<div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="p">{</span> <span class="na">dataPass</span><span class="p">:</span> <span class="dl">"</span><span class="s2">bingo</span><span class="dl">"</span><span class="p">,</span> <span class="na">mediaPass</span><span class="p">:</span> <span class="dl">"</span><span class="s2">bobbo</span><span class="dl">"</span> <span class="p">};</span>
<span class="kd">const</span> <span class="nx">cloud</span> <span class="o">=</span> <span class="nx">app.CreateCloudStore</span><span class="p">(</span> <span class="dl">"</span><span class="s2"><YOUR_CLOUDSTORE_KEY></span><span class="dl">"</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">options</span> <span class="p">)</span>
</code></pre></div>
<blockquote>
<aside class="notice-right">You must replace <code><YOUR_CLOUDSTORE_KEY></code> with your unique CloudStore API key which you would have received when registering with droidscript.cloud/</aside>
</blockquote>
<h1 id='data'>Data</h1><h2 id='saving-data'>Saving data</h2><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="nx">Save</span><span class="p">(</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">callback</span><span class="p">,</span> <span class="nx">password</span> <span class="p">)</span>
</code></pre></div><h3 id='query-parameters-2'>Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>key</td>
<td>yes</td>
<td>A string id to identify the data to store. This value is case sensitive.</td>
</tr>
<tr>
<td>value</td>
<td>yes</td>
<td>The data to store. You can store a string, integer, or even pass a JavaScript object.</td>
</tr>
<tr>
<td>callback</td>
<td>no</td>
<td>A function that returns a response object: response. If response.error is null, you can access the data through response.data.</td>
</tr>
<tr>
<td>password</td>
<td>no</td>
<td>Password to write over the data file if already exists (Passwords are set in the CloudStore <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a>). If a password has been set and you do not pass the correct value, you will get an error.</td>
</tr>
</tbody></table>
<h3 id='example'>Example</h3><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="c1">//Save some data.</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Save</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="p">{</span><span class="dl">"</span><span class="s2">Apples</span><span class="dl">"</span><span class="p">:</span><span class="mi">8</span><span class="p">,</span><span class="dl">"</span><span class="s2">Oranges</span><span class="dl">"</span><span class="p">:</span><span class="mi">6</span><span class="p">},</span> <span class="nx">onSave</span> <span class="p">)</span>
<span class="c1">//Handle the response.</span>
<span class="kd">function</span> <span class="nx">onSave</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div><h2 id='loading-data'>Loading data</h2><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="nx">Load</span><span class="p">(</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">callback</span><span class="p">,</span> <span class="nx">password</span> <span class="p">)</span>
</code></pre></div><h3 id='query-parameters-3'>Query Parameters</h3>
<table><thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>key</td>
<td>yes</td>
<td>A string id to identify the data to store. This value is case sensitive.</td>
</tr>
<tr>
<td>callback</td>
<td>no</td>
<td>A function that returns a response object: response. If response.error is null, you can access the data through response.data.</td>
</tr>
<tr>
<td>password</td>
<td>no</td>
<td>Password to access the data file (Passwords are set in the CloudStore <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a>). If a password has been set and you do not pass the correct value, you will get an error.</td>
</tr>
</tbody></table>
<h3 id='example-2'>Example</h3><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="c1">//Load some data.</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Load</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="nx">onLoad</span> <span class="p">)</span>
<span class="c1">//Handle the response.</span>
<span class="kd">function</span> <span class="nx">onLoad</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">response</span><span class="p">.</span><span class="nx">data</span><span class="p">)</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div><h2 id='merging-data'>Merging data</h2><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="nx">Merge</span><span class="p">(</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">value</span><span class="p">,</span> <span class="nx">callback</span><span class="p">,</span> <span class="nx">password</span> <span class="p">)</span>
</code></pre></div>
<p>The <strong>Merge</strong> function allows you to merge and update existing data objects. If the data object you are trying to merge with does not exist, it will create a new object.</p>
<p>The function recursively merges values passed from the source object, replacing existing data and adding new data. It will also recursively merge arrays.</p>
<table><thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>key</td>
<td>yes</td>
<td>A string id to identify the data to merge</td>
</tr>
<tr>
<td>value</td>
<td>yes</td>
<td>A JavaScript data object containing the data you want to merge with the source object. If no source object exists, a new object will be created</td>
</tr>
<tr>
<td>callback</td>
<td>no</td>
<td>A function that returns a response object: response. If response.error is null, you can access the data through response.data.</td>
</tr>
<tr>
<td>password</td>
<td>no</td>
<td>Password to access data file if one is set</td>
</tr>
</tbody></table>
<h3 id='example-3'>Example</h3><h4 id='app-1'>App 1</h4><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="c1">// Save some data.</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Save</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="p">{</span><span class="dl">"</span><span class="s2">Apples</span><span class="dl">"</span><span class="p">:</span><span class="mi">8</span><span class="p">,</span><span class="dl">"</span><span class="s2">Oranges</span><span class="dl">"</span><span class="p">:</span><span class="mi">6</span><span class="p">},</span> <span class="nx">onSave</span> <span class="p">)</span>
<span class="kd">function</span> <span class="nx">onSave</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div><h4 id='app-2'>App 2</h4><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="c1">// Update our Shopping List by adding a new item and changing existing items.</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Merge</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="p">{</span><span class="dl">"</span><span class="s2">Apples</span><span class="dl">"</span><span class="p">:</span><span class="mi">8</span><span class="p">,</span><span class="dl">"</span><span class="s2">Oranges</span><span class="dl">"</span><span class="p">:</span><span class="mi">10</span><span class="p">,</span><span class="dl">"</span><span class="s2">Bananas</span><span class="dl">"</span><span class="p">:</span><span class="mi">8</span><span class="p">},</span> <span class="nx">onMerge</span> <span class="p">)</span>
<span class="c1">// Handle the response.</span>
<span class="kd">function</span> <span class="nx">onMerge</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="p">{</span>
<span class="c1">// Data merged successfully </span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="c1">// Lets now reload the data to see if our object has changed</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Load</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="nx">onLoad</span> <span class="p">)</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="c1">// Handle the response.</span>
<span class="kd">function</span> <span class="nx">onLoad</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="c1">// You should now see your new Shopping_List with 10 Oranges and 8 Bananas</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">response</span><span class="p">.</span><span class="nx">data</span><span class="p">)</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div><h2 id='listing-data-files'>Listing Data Files</h2><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="nx">List</span><span class="p">(</span> <span class="nx">filter</span><span class="p">,</span> <span class="nx">callback</span> <span class="p">)</span>
</code></pre></div>
<p>The <strong>List</strong> function allows you to get a comma separated list of all your data files that match the filter. </p>
<p>For example, if you had two data files with the keys "steve1" and "steve2" and called the <strong>List</strong> function like this:</p>
<div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="nx">List</span><span class="p">(</span> <span class="dl">"</span><span class="s2">steve</span><span class="dl">"</span><span class="p">,</span> <span class="nx">callback</span> <span class="p">)</span>
</code></pre></div>
<p>You would get back a comma separated string that looked like this: "steve1,steve2".</p>
<table><thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>filter</td>
<td>yes</td>
<td>A string containing the word you want to search for. This is case sensitive. If you pass and empty string "", it will return <strong>all</strong> your data files.</td>
</tr>
<tr>
<td>callback</td>
<td>yes</td>
<td>A function that returns a response object: response. If response.error is null, you can access the data through response.data.</td>
</tr>
</tbody></table>
<h3 id='example-4'>Example</h3><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="nx">List</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping</span><span class="dl">"</span><span class="p">,</span> <span class="nx">onList</span> <span class="p">)</span>
<span class="c1">//Handle the response.</span>
<span class="kd">function</span> <span class="nx">onList</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">data</span> <span class="p">)</span>
<span class="c1">// </span>
<span class="p">}</span>
</code></pre></div>
<blockquote>
<aside class="notice-right">response.data will show a comma separated list of all files matching your filter</aside>
</blockquote>
<h2 id='deleting-data'>Deleting data</h2><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="k">Delete</span><span class="p">(</span> <span class="nx">key</span><span class="p">,</span> <span class="nx">callback</span><span class="p">,</span> <span class="nx">password</span> <span class="p">)</span>
</code></pre></div>
<p>The <strong>Delete</strong> function allows you to delete existing data objects from the CloudStore.</p>
<p>You delete cloudstore objects by sending the id of the item you wish to remove.
If you try removing an object that does not exist, it will return with an error <strong>NoFile</strong>.</p>
<table><thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>key</td>
<td>yes</td>
<td>A string id to identify the data store to delete. This is case sensitive.</td>
</tr>
<tr>
<td>callback</td>
<td>no</td>
<td>A function that returns a response object: response. If response.error is null, you can access the data through response.data.</td>
</tr>
<tr>
<td>password</td>
<td>no</td>
<td>The value for the <strong>edit</strong> password set in the CloudStore <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a></td>
</tr>
</tbody></table>
<h3 id='example-5'>Example</h3><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="k">Delete</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="nx">onDelete</span> <span class="p">)</span>
<span class="c1">//Handle the response.</span>
<span class="kd">function</span> <span class="nx">onDelete</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div><h2 id='password-protection'>Password Protection</h2>
<p>You can control <strong>read</strong> and <strong>write</strong> access to your data files by setting a password to each file in the CloudStore <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a>. </p>
<p>To see an example of this in action please see the section <a href="#dashboard">Dashboard</a> below.</p>
<h1 id='media'>Media</h1>
<p>CloudStore allows you to store media files (text and image files) in the cloud so they can be accessed across multiple apps
and stay persistent event when your app is removed from your device.</p>
<blockquote>
<aside class="notice-right">To access your media files across multiple apps, you must use the same api key in each app</aside>
</blockquote>
<h2 id='upload'>Upload</h2><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="nx">cloud</span><span class="p">.</span><span class="nx">Upload</span><span class="p">(</span> <span class="nx">data</span><span class="p">,</span> <span class="nx">filename</span><span class="p">,</span> <span class="nx">type</span><span class="p">,</span> <span class="nx">callback</span><span class="p">,</span> <span class="nx">password</span> <span class="p">)</span>
</code></pre></div>
<p>The <strong>Upload</strong> function allows you to upload a file to the cloud. You can set permissions for editing files in the <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a></p>
<table><thead>
<tr>
<th>Parameter</th>
<th>Required</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td>data</td>
<td>yes</td>
<td>A base64 formatted string OR a file in a blob format.</td>
</tr>
<tr>
<td>filename</td>
<td>yes</td>
<td>The filename you want it stored as. This will be case sensitive when reading. Do not use spaces in your filenames.</td>
</tr>
<tr>
<td>type</td>
<td>no</td>
<td>The file type being uploaded (e.g. "image/jpg" or "text")</td>
</tr>
<tr>
<td>callback</td>
<td>no</td>
<td>A function that returns a response object. If response.error is null, response.data will return a json string with 'name', 'folder', 'id', 'mimetype' and 'size'.</td>
</tr>
<tr>
<td>password</td>
<td>no</td>
<td>A password if one has been set in the <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a></td>
</tr>
</tbody></table>
<blockquote>
<aside class="notice-right">There are no limitations to what file types can be uploaded, so long as they can be turned into a blob. Alternatively if you have a file already in a blob format, you can pass this directly in to the data parameter.</aside>
</blockquote>
<h3 id='example-6'>Example</h3><div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="c1">// Let's assume you want to upload an image to the CloudStore</span>
<span class="c1">// You must upload images as a string in a format such as base64</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Upload</span><span class="p">(</span> <span class="nx">file_data</span><span class="p">,</span> <span class="dl">"</span><span class="s2">jazz3.jpg</span><span class="dl">"</span><span class="p">,</span> <span class="dl">"</span><span class="s2">image/jpg</span><span class="dl">"</span><span class="p">,</span> <span class="nx">onUpload</span> <span class="p">)</span>
<span class="kd">function</span> <span class="nx">onUpload</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">data</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div><h2 id='file-location'>File Location</h2>
<p>You can copy the full path to your file in the CloudStore <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a>. For more information on this read the section on <a href="#media">Media Files</a> below.</p>
<blockquote>
<aside class="notice-right">Media paths are unique and unguessable (non sequential) for safe sharing publically or privately.</aside>
</blockquote>
<h2 id='password-protection-2'>Password Protection</h2>
<p>You can control <strong>edit</strong> access to your media files by setting a password to each file in the CloudStore <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a>.</p>
<p>If a password has been set on a media file then you must include the password as the final parameter in the <strong>Upload</strong> function call.</p>
<p>An example can be seen in the following section.</p>
<h1 id='dashboard'>Dashboard</h1><h2 id='loading'>Loading</h2>
<ul>
<li>Navigate to <a href="https://droidscript.cloud/cloudstore/admin.html">https://droidscript.cloud/cloudstore/admin.html</a></li>
<li>Log in using your <strong>Username</strong> and <strong>Password</strong> - Passwords are auto generated and are sent to you via email</li>
<li>You should now be at the droidscript.io dashboard</li>
</ul>
<h2 id='user-info'>User Info</h2>
<p><img src="images/dashboard_user_info-e71b18c7.png" alt="" /></p>
<p>The <strong>user info</strong> panel displays all your configuration data including your API key and Media path to access your media files</p>
<h2 id='data-files'>Data Files</h2>
<p><img src="images/dashboard_data_files-90175cf0.png" alt="" /></p>
<p>The <strong>data files</strong> panel displays all your uploaded data files. If you click on the names of the files, you will see information on usage and size appear
in the panel to the right of the list.</p>
<h3 id='password-protection-3'>Password Protection</h3>
<p>It is possible to control <strong>view</strong> and <strong>edit</strong> access to data files inside the <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a>.</p>
<p>To the right of each file is a checkbox. Select a checkbox and you will see the <strong>delete</strong> and <strong>padlock</strong> icons highlighted.</p>
<p><img src="images/dashboard_df_pwd_1-eecce227.png" alt="" /></p>
<p>If you press the <strong>padlock</strong> icon you will see a dialog box appear allowing you to set a password for <strong>view</strong> or <strong>edit</strong> access to all selected files</p>
<p><img src="images/dashboard_df_pwd_2-b5df1c45.png" alt="" /></p>
<p>Set the password to enable <strong>edit</strong> control. Now you will need to pass this password as the final parameter when using the <strong>Merge</strong> or <strong>Save</strong> functions.</p>
<blockquote>
<aside class="notice-right">Try not to hard code the password in your application. Use a prompt to capture the password.</aside>
</blockquote>
<h3 id='example-7'>Example</h3>
<p>Here we set an <strong>edit</strong> password to our <strong>Shopping_List</strong> data file</p>
<p><img src="images/dashboard_df_pwd_3-27173546.png" alt="" /></p>
<p>Now let's see what happens if we try merging new items into our shopping list without appending the password to our <strong>Merge</strong> function</p>
<div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="kd">function</span> <span class="nx">btnMerge_OnTouch</span><span class="p">()</span>
<span class="p">{</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Merge</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="p">{</span> <span class="na">plums</span><span class="p">:</span><span class="mi">5</span> <span class="p">},</span> <span class="nx">onMerge</span> <span class="p">)</span>
<span class="p">}</span>
<span class="kd">function</span> <span class="nx">onMerge</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">response</span><span class="p">.</span><span class="nx">data</span><span class="p">)</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div>
<p>If you try to run the code above you will get the following response in response.error: <strong>Locked</strong>.</p>
<p>Now let's send the correct password as the final parameter in the <strong>Merge</strong> function like so:</p>
<div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="kd">function</span> <span class="nx">btnMerge_OnTouch</span><span class="p">()</span>
<span class="p">{</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Merge</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Shopping_List</span><span class="dl">"</span><span class="p">,</span> <span class="p">{</span> <span class="na">plums</span><span class="p">:</span><span class="mi">5</span> <span class="p">},</span> <span class="nx">onMerge</span><span class="p">,</span> <span class="dl">"</span><span class="s2">12345</span><span class="dl">"</span> <span class="p">)</span>
<span class="p">}</span>
<span class="kd">function</span> <span class="nx">onMerge</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">response</span><span class="p">.</span><span class="nx">data</span><span class="p">)</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div>
<p>If you now run this code you will see the message <strong>Entry saved</strong>.</p>
<h2 id='media-files'>Media Files</h2>
<p><img src="images/dashboard_media_files-70a5e32a.png" alt="" /></p>
<p>The <strong>media files</strong> panel lists all your uploaded media files. Like the data files panel, if you click on the filenames it will show you details about the uploaded file
including a preview snapshot of the file if it's an image file.</p>
<h3 id='file-location-2'>File Location</h3>
<p>To find the full path of your media file simply highlight your file and press the copy link button in the right panel.</p>
<p><img src="images/dashboard_media_files_2-d900ca9e.png" alt="" /></p>
<blockquote>
<aside class="notice-right">Media paths are unique and unguessable (non sequential) for safe sharing publically or privately.</aside>
</blockquote>
<h3 id='password-protection-4'>Password Protection</h3>
<p>It is possible to control <strong>edit</strong> access to files uploaded to the <strong>CloudStore dashboard</strong>.</p>
<p>To the right of each file is a checkbox. If you select one or more files using the checkboxes you will see the <strong>delete</strong> and <strong>padlock</strong> icons highlighted.</p>
<p><img src="images/dashboard_mf_pwd_1-015ccceb.png" alt="" /></p>
<p>If you press the <strong>padlock</strong> icon you will see a dialog box appear allowing you to set a password for <strong>edit</strong> access to all selected files</p>
<p><img src="images/dashboard_mf_pwd_2-c5e9dccb.png" alt="" /></p>
<p>Set the password to enable <strong>edit</strong> control. Now whenever a user tries to edit this file they will need to pass along the password to each function call.</p>
<blockquote>
<aside class="notice-right">Don't hard code passwords in your application. Use a prompt to capture the password.</aside>
</blockquote>
<h3 id='example-8'>Example</h3>
<p>We want to protect our uploaded file "jazz3.jpg" from being overwritten by unauthroised users.</p>
<p>To do this we:
- Assign a password to the file using our <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a>
- Now whenever we want to override the file, we must include the password as our final parameter in the <strong>Upload</strong> function</p>
<p>For thie example we have assigned the password as <strong>12345</strong></p>
<div class="highlight"><pre class="highlight javascript tab-javascript"><code><span class="c1">// Let's assume you want to upload an image to the CloudStore</span>
<span class="c1">// You must upload images as a string in a format such as base64</span>
<span class="nx">cloud</span><span class="p">.</span><span class="nx">Upload</span><span class="p">(</span> <span class="nx">file_data</span><span class="p">,</span> <span class="dl">"</span><span class="s2">jazz3.jpg</span><span class="dl">"</span><span class="p">,</span> <span class="dl">"</span><span class="s2">image/jpg</span><span class="dl">"</span><span class="p">,</span> <span class="nx">onUpload</span><span class="p">,</span> <span class="dl">"</span><span class="s2">12345</span><span class="dl">"</span> <span class="p">)</span>
<span class="kd">function</span> <span class="nx">onUpload</span><span class="p">(</span> <span class="nx">response</span> <span class="p">)</span>
<span class="p">{</span>
<span class="k">if</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="p">)</span> <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span> <span class="dl">"</span><span class="s2">Error: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">error</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">, </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">response</span><span class="p">.</span><span class="nx">message</span> <span class="p">)</span>
<span class="k">else</span> <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span> <span class="nx">response</span><span class="p">.</span><span class="nx">data</span> <span class="p">)</span>
<span class="p">}</span>
</code></pre></div>
<p>If you run this code you should get a response back with the messsage: <strong>File Uploaded</strong></p>
<p>You can see you uploaded file in your using our <a href="https://droidscript.cloud/cloudstore/admin.html">admin dashboard</a></p>
</div>
<div class="dark-box">
<div class="lang-selector">
<a href="#" data-language-name="javascript">javascript</a>
</div>
</div>
</div>
</body>
</html>