could not access the file imported from iCloud pages - ios8

I am trying to build an app that imports files from other apps to my app using UIDocumentMenuViewController(in UIDocumentPickerModeImport mode). I could able to do successfully with apps like dropbox. When i try do the same with iCloud pages, file gets copied to the the folder 'DocumentPickerIncoming', But I get the below error when I try to get the contents of the file.
The operation couldn’t be completed. Permission denied

Related

How do I read from a folder in the user's home directory from an Xcode Source Editor Extension?

I created an Xcode Source Editor Extension. I'd like to build a linting command, for example. The user's existing lint file is located in a location like /Users/Tim/CalculatorApp/swiftlint.yml.
If I try to use try! String(contentsOfFile: "/Users/Tim/CalculatorApp/swiftlint.yml"), I get the error:
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=257 "The file “.swiftlint.yml” couldn’t be opened because you don’t have permission to view it."
This is most likely because the extension is running in a sandbox and doesn't have permission to read files under the user's home directory. I tried removing the sandbox from the Extension's target, but then the extension doesn't load at all.
I get the error:
Could not attach to pid : “3623”
attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries when the attached failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)
If I re-add the App Sandbox, clean the project, then run again, I no longer get this error. This leads me to believe that Xcode Extensions might need to be run in App Sandbox mode.
Is there a way to run an Xcode Extension without App Sandbox mode?
Are there any other workarounds for how to allow the Xcode extension to read the file in question? I was thinking about using the "User Selected File" permission, but I don't see how that would work with an Extension which has no UI.
Any other thoughts for how to get something like this to work?

Failed to create IPA archive after upgrade to Xcode 11.4.1, VS for Mac 8.5.4, and Xamarin.iOS 13.16

After upgrading to the latest versions of Visual Studio for Mac, Xamarin, and Xcode, I am unable to create a signed IPA archive. Everything runs on the simulator, everything builds fine in my release configuration. I can even create the archive just fine. But after I click "Sign and Distribute", regardless of whether I try to publish to the App Store or simply save the IPA to disk, I get the extremely generic "Failed to create IPA archive" message with no other detail about what failed.
As always with these types of problems, this worked the last time I tried to publish (2 months ago). Even trying to use "Sign and Distribute" on an archive I previously published successfully to the App Store fails with the same message. Are there any logs for this where I can see exactly what is failing? The Archive output window at the bottom of the screen doesn't show activity for this stage of the process.
UPDATE:
After finding the logs, was able to see the following error that shows that for some reason after upgrading the apps, permissions were somehow lost for creating the zip archive:
zip -r -y "/Applications/Xcode.app/MyApp.ipa" Payload
zip I/O error: Permission denied
zip error: Could not create output file (/Applications/Xcode.app/MyApp.ipa)
zip exited with code 15
ERROR:Failed to create IPA archive.
Finshed
So now the question becomes why, and what steps need to be taken to fix this the proper way (i.e., not just brute-forcing broad permissions)?
Are there any logs for this where I can see exactly what is failing?
To find Mac logs through:
You can select the Go > Go to Folder menu item in Finder, and then copy and paste any of these paths into the dialog.
Visual Studio for Mac
~/Library/Logs/VisualStudio/7.0 (this number may change depending on
the version you are using)
This folder can also be opened via "Help -> Open Log Directory".
If you meet the Permission denied error in the log, this may be due to saving the IPA in the XCode.App folder. You can try a different location.
If you still meet problem, you can send a feed back inside visual studio for more help.
It's very likely due to permission issue while zipping the archive.
To check if it's your case:
Open the log folder at ~/Library/Logs/VisualStudio/7.0 or in Visual Studio for Mac Help > Open Log Directory
Find and open the last log file for publishing (like Publishing.yyyy-mm-dd__hh-mm-ss.log)
Scroll to the last rows of that file. If it contains something like this (see the block below) so it's your case
zip I/O error: Permission denied
zip error: Could not create output file (/Applications/Xcode.app/YourApp.ipa)
zip exited with code 15
ERROR:Failed to create IPA archive.
Finished
In this case, once you see Output IPA file popup, just choose other save location (Desktop for example)

dhcpsapi.exe File keep running in task manager

I have a file with description "Подключаемый модуль пересылки событий WS-Management" and name dhcpsapi.exe running in task manager. It seems like a virus to me.Whenever i tried to delete or open its location i am getting access denied in my admin account.Tried to delete it from cmd-Administrator but keep getting the error 'Access Denied'.
I can't see its folder in file explorer or in hidden files but can see it in command prompt (dir /a).
I need to access this folder and delete it. How do i access it from command prompt or from windows explorer.
Screenshot of file properties
Resolved. I unchecked hide protected items from folder options. Then gave permission to User but it was still inaccessible and windows defender scanned that folder and identified it as a trojan virus and removed the process from task manager. Then i deleted that folder with a software 'unlocker' from drive and recycle bin.
Screenshot of file details

Nativescript - permission needed for saving file to DOWNLOAD folder (Android)

android.os.Environment.getExternalStoragePublicDirectory( android.os.Environment.DIRECTORY_DOWNLOADS )
I'm saving a file to the download folder and also asking for
android.permission.WRITE_EXTERNAL_STORAGE. Is that required?
Also - the system permission message is a more ominous permission
required for Photo folder or something similar and some users
have questioned why I need that.
I'm downloading an APK file just before installing it.

accessing image from public_html not possible

I am using Cyberhost.in to host a JSF application. The problem that I am facing is that whenever I am trying to access image files from public_html folder I am getting a 404 error. I have kept my war file in webapps folder. I am using c-panel, the thing is that I want to take backup of files for my website so I have kept them in public_html folder. Initially I was saving the files under webapps/[WAR FILE NAME] but when ever I was trying to overwrite webapps/[WAR FILE NAME] I was getting permission denied error.
You should upload image files on their location that you have mentioned in your code, otherwise you should change the location in website code of the same.
Also check permissions/ownership of files

Resources