file-access

Access music files UWP -KnownFolders.MusicLibrary.GetItemsAsync() doesnt return anything

醉酒当歌 提交于 2020-01-07 01:23:11
问题 Hey i have the following : var fileList = await KnownFolders.MusicLibrary.GetItemsAsync(); It doesn't return any files and i have files in the Music folder. I also have : <Capabilities> <Capability Name="internetClient" /> <Capability Name="removableStorage" /> <Capability Name="documentsLibrary" /> <Capability Name="MusicLibrary" /> <Capability Name="HomeGroup" /> <Capability Name="RemovableDevices" /> I dont know why it doesnt return any files/ exception ? Any suggestions ? I also tried

How to deny access to images uploaded by other user?

独自空忆成欢 提交于 2020-01-05 04:36:07
问题 In a web application to transform images I want to deny direct access to other user's images and I've achieve it adding this code at my main .htaccess file: RewriteCond %{HTTP_COOKIE} !PHPSESSID=(.+) [OR,NC] RewriteCond %{HTTP_COOKIE}:%{REQUEST_URI} ^PHPSESSID=(.*?);:(?!.*?/usuarios/\1).* [NC] RewriteRule ^.*?/usuarios/.+?\.(gif|jpe?g|png|wbmp)$ - [R=403,L] So, as users have their own folder to upload and transform images, this rule will check if you are looking for an image which directory

Encrypting .txt File Erroring - Process Cannot Access File

心已入冬 提交于 2020-01-05 04:04:18
问题 I'm trying to encrypt a .txt file which is created in my application. To create this file, I'm using the following code: Dim fileExists As Boolean = File.Exists(directorypath & "dbpw.txt") If File.Exists(directorypath & "dbpw.txt") = False Then Using sw As New StreamWriter(File.Open(directorypath & "dbpw.txt", FileMode.Create)) IIf(fileExists, "", "") sw.Close() End Using End If Then, to write and encrypt the file, I'm using the following code, calling subroutines that I tweaked from examples

How to access a single record with Fortran unformatted direct-access when the appropriate RECL is not known?

荒凉一梦 提交于 2020-01-04 06:56:17
问题 Unless using the new-ish stream-access available in F2003, Fortran classically considers files to be a sequence of records. If a file is connected for direct-access one can access any record in any order by specifying the record number. For example: open(newunit=funit, file=filename, form='unformatted', access='direct', & recl=64, status='old') read(funit, rec=2) data close(funit) So this sounds great...however, I'm not sure I understand the RECL parameter and how direct-access can be used

Why do the System.IOUtils functions and TStreamReader use fmShareCompat?

萝らか妹 提交于 2020-01-02 03:50:29
问题 When I first saw the System.IOUtils unit with functions like TFile.ReadAllBytes and TFile.ReadAllText and the TStreamReader and TBinaryReader classes in System.Classes I was quite excited to have easy ways to read binary and text files. After using them for a while I noticed that the default share mode is implicitly fmShareCompat , since they all use TFileStream.Create , but do not explicitly specify a share mode. Since fmShareCompat is treated as fmShareExclusive on Windows this leads to

Help securing files access with htaccess and php?

拈花ヽ惹草 提交于 2019-12-29 09:23:09
问题 I'm working on a site that allows users to purchase digital content and have implemented a method that attempts to serve secure downloads. I'm using CodeIgniter to force downloads like this: $file = file_get_contents($path); force_download("my_file_name.zip", $file); Of course, I make sure the user has access to the file using a database before serving the download, but I was wondering if there was a way to make these files more secure. I'm using a some 8-10 letter keys to create the file

Checking if a file is in use without try catch?

梦想与她 提交于 2019-12-29 07:31:51
问题 Is there a way I can check if a file is in use or is not opened by other process without just trying to open it and catching an exception? Is there no service method to test such a thing? 回答1: Even if there was, it wouldn't do you much good since you would still have to catch the exception in order to handle the race condition where the file became unavailable in between your initial check and your actual attempt to open/access it. I can't think of any compelling advantage to a preliminary

WP8 copy SharedStorge file directly into IsolatedStorage

我只是一个虾纸丫 提交于 2019-12-25 02:41:28
问题 I am developing a Windows Phone 8 application but am having a lot of issues with file access permission exceptions hindering the approval of my application when ever I try accessing files in the "local" folder (this only happens after the application has been signed by the WP store, not when deployed from Visual Studio). To solve this I have moved all file operations to IsolatedStorage and this seems to have fixed the problems. I only have one problem left though. My application needs to make

What is the difference between file and random access file?

倖福魔咒の 提交于 2019-12-21 17:42:16
问题 what is the difference between file and random access file? 回答1: A random access file is a file where you can "jump" to anywhere within it without having to read sequentially until the position you are interested in. For example, say you have a 1MB file, and you are interested in 5 bytes that start after 100k of data. A random access file will allow you to "jump" to the 100k-th position in one operation. A non-random access file will require you to read 100k bytes first, and only then read

Phonegap - How to access file in www-folder?

江枫思渺然 提交于 2019-12-19 04:09:45
问题 I saw multiple solutions how to access a file in the www folder but no solution works for me. I test the application under iOS with the iOS-simulator. I want to access the file test.txt in the www folder. My current solution looks like this: var filePathURI = getPhoneGapPath() + "test.txt"; window.resolveLocalFileSystemURI(filePathURI, onResolveSuccess, onFail); function getPhoneGapPath() { 'use strict'; var path = window.location.pathname; var phoneGapPath = path.substring(0, path