storage

How can I save a StorageFile to use later?

旧城冷巷雨未停 提交于 2019-12-24 06:52:11
问题 I am working in WinRT, and I am kind of stuck: I am writing a music player with a media library capability. I keep information about the music (such as artists etc) in a SQLite database. I wanted to let the user keep his music anywhere he wants to, instead of the windows way, where it all has to be in the 'Music' library. Users can add the music inside folders using a folder picker. The problem I have is this: how can I access these files later, e.g after the application restarts? Keeping the

Android check for SD Card mounted always returns true

非 Y 不嫁゛ 提交于 2019-12-24 04:16:51
问题 I'm not sure what the source of the problem is - older android version with bug or if I'm doing something wrong, but my problem is that no matter what I do, android reports the SD card as mounted. Even if it's not physically in the tablet (archos 7o).. public boolean saveToDisk(String filename, String header) { /* first check to see if the SD card is mounted */ if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { //throw some exception so we can display an error

Can I use the same HTML5 browser storage, across different domains?

有些话、适合烂在心里 提交于 2019-12-24 04:15:08
问题 There are a couple of different approaches for choosing an HTML5 browser storage (IndexedDB, Web Storage), but from what I read in the spec, the "same origin policy applies". Is there a way to keep data inside the browser and have it available from both www.domain1.com/myapp1 and www.domain2.com/myapp2? 回答1: Cross-Document Messaging You can use a technique called cross-document messaging to accomplish this. There is an article here that outlines how to implement it, but it's basically where

Better way to store large files in a MySQL database?

我与影子孤独终老i 提交于 2019-12-24 04:04:24
问题 I have a PHP script that you can upload very large files with (up to 500MB), and the file's content is stored in a MySQL database. Currently I do something like this: mysql_query("INSERT INTO table VALUES('')"); $uploadedfile = fopen($_FILES['file']['tmp_name'], 'rb'); while (!feof($uploadedfile)) { $line = mysql_escape_string(fgets($uploadedfile, 4096)); mysql_query("UPDATE table SET file = CONCAT(file, '$line') WHERE something = something"); } fclose($uploadedfile); This of course does a

how to use phonegap-2.9.0 camera and store in android device?

心不动则不痛 提交于 2019-12-24 03:08:39
问题 NOTE: I was being stupid, for so many things I tried the picture DOES save into my local storage but I kept on checking my gallery (always thought gallery would scan all the images) but somehow it's not in my gallery so I kept on thinking the image didn't save I'm using phonegap 2.9.0 and playing with the camera API. The phonegap documentation even provided a full html example which you can just copy and paste the code into the www folder and deploy and camera works perfectly just that it

how to use phonegap-2.9.0 camera and store in android device?

最后都变了- 提交于 2019-12-24 03:08:17
问题 NOTE: I was being stupid, for so many things I tried the picture DOES save into my local storage but I kept on checking my gallery (always thought gallery would scan all the images) but somehow it's not in my gallery so I kept on thinking the image didn't save I'm using phonegap 2.9.0 and playing with the camera API. The phonegap documentation even provided a full html example which you can just copy and paste the code into the www folder and deploy and camera works perfectly just that it

Android Dev: Accessing external SD card directly on Samsung devices (with extSdCard path)?

为君一笑 提交于 2019-12-24 00:33:33
问题 I'm learning Android development so am relatively new to some of the technical Android concepts, but I do have a strong developer background. I am writing an app that I want to be able to directly access files on the user's SD card. The test device is a Samsung Galaxy Tab 4. Samsung appears to use a custom method of mounting the SD card, placing it at /storage/extSdCard rather than the more traditional /sdcard . In my app, I used the method Environment.getExternalStoragePublicDirectory method

Laravel 5.3 store and read file directories

穿精又带淫゛_ 提交于 2019-12-23 19:03:09
问题 Currently trying to play about with files but struggling to figure out where to put them and how to read them back in a list. Ive tried putting few test files into $files = array(); $dir = opendir(asset('files'); // open the cwd..also do an err check. while(false != ($file = readdir($dir))) { if(($file != ".") and ($file != "..") and ($file != "index.php")) { $files[] = $file; // put in array. } } but it just returns blank despite having 3 test files in it. Looked into larval recipes and

How should I serialize an array of Moose objects?

一笑奈何 提交于 2019-12-23 17:11:12
问题 I use MooseX::Storage for serialization of Moose objects. Can I use it for serialization of multiple Moose objects to the same file, or more specifically, an array or a hash of Moose objects? I guess I can define another Moose objects ('array_of_myobj') but this isn't very elegant. So, how would you recommend to serialize an array (or a hash) of Moose objects? 回答1: You don't have to let MooseX::Storage manage your file IO just because it's available. You could use it to pack your objects into

How to store database credentials in a desktop application? [closed]

不羁岁月 提交于 2019-12-23 15:47:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . The scenario is this: There is a desktop Java application running on a random computer, out of the developer's control. That application connects to a MySQL server installed on the same computer. Is there a way to keep the database login credentials secure from the local user? I can imagine that, being the admin