Hello I have this code and don't download anything...
FTPHelper *ftp;
ftp.urlString = #"ftp.marignal.com";
ftp.uname = #"whttpapp.marignal.com";
ftp.pword = #"hidden";
ftp.filePath = #"Barcos/Imagenes";
[ftp download:#"catlanza.bmp"];
I'm using this lib: https://github.com/erica/iphone-3.0-cookbook-/tree/master/C13-Networking/15-FTP%20Helper
That method download, It suppose to install the selected file in Documents directory...
Look in the simulator for the path it copied to.
Likely you need to tack on Documents:
ftp.filePath = #"Documents/Barcos/Imagenes";
Or get the path programmatically:
What is the documents directory (NSDocumentDirectory)?
Related
I want to upload a file using playwright, but as I'm using a wsl, I don't know where I should put the file, for sure not in the windows folder, but where? Cause I tried to put it in the mounted disk in ubunbtu, but it isn't editable, I'm using SetInputFiles().
In the image you can see the file manager that playwright opens, i cant find the node folder in the image.Image
You can keep the file in the project fiolder itself and give relative path for that file. Make one folder in project name it as 'TestData' and copy file in the folder. if file name is test.png then you can give path as give below.
let path = require('path');
let fileToUpload = '/testData/fileUpload/' + fileName;
let absolutePath = path.resolve(process.cwd() + fileToUpload);
await this.page.locator("input[type='file']").setInputFiles(absolutePath);
I am using Qt app on iOS & want to save files into Application's private directory so that other apps cannot access my files. Reading through the documentation here, /Documents directory under data container looks to be the path to save my files which are private to app.
Firstly I chose to use QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) which returned
/var/mobile/Containers/Data/Application/123XX-XXXX-XXXX-XXXX/Library/Application Support/MyApp. But then I found that I could not create any files in there. Tried /Documents inside the App folder as well. But in vain.
Secondly I tried QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) which returned /var/mobile/Containers/Data/Application/123XX-XXXX-XXXX-XXXX/Documents. I am able to create & save my files here.
On iOS, which is the correct path to create files which are meant to be private to the application ?
How can I get the path using Qt?
The directory named with some ID as 123XX-XXXX-XXXX-XXXX, Is this the application directory or is it Library/Application Support/MyApp inside the same directory ?
I had same problem, for example I created a sqlite file. But the file that you will create can be every file you wants. In my example I need to create a sqlite file.
I solved like this:
QString dbName = "mydb.sql";
QString dbLocation;
#ifdef Q_OS_ANDROID
dbLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
#endif
#ifdef Q_OS_IOS
dbLocation = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
#endif
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(dbLocation + "/" + dbName);
qDebug() << db.database(dbLocation + "/" + dbName);
qDebug() << db.databaseName();
Now you can save the file, I used DocumentsLocation to get a path, always works on iOS, but not work on Android, to be ready to Android you use another path: AppDataLocation.
In the documents location you can write/read/put and create files on iOS.
In the AppDataLocation location you can write/read/put and create files on Android.
Permission not denied in DocumentsLocation.
3.2 for developing a game.I have developed game in android but facing a problem in iOS i.e
I am facing problem to read resource images.In my game have 3 stages "Simple","Medium" and "Hard".I have put images on the following path
# "Simple/1.png","Medium/1.png","Hard/1.png"
# "Simple/2.png","Medium/2.png","Hard/2.png"
# ------------------------------------------
# ------------------------------------------
# "Simple/n.png","Medium/n.png","Hard/n.png"
In android getting correct image by using full path of image.
But in iOS it is not working.
How i can fetch image of same name from different directory in iOS.
You should probably use FileUtils::addSearchPath() and add "Simple", "Medium" or "Hard", depending on the game stage and then you can use just "1.png" to refer to the file from various Cocos2d-x APIs.
landge,
Please try this:
See my screenshot using cocos2d-x-3.6
http://prntscr.com/7zwty9
It shows Xcode with 3 files with the same name 1.png in different absolute directories: hard/medium/simple.
vector<string> searchPaths = fu->getSearchPaths();
fu->addSearchPath("res/medium");
CCLOG("fpff = %s", fu->fullPathForFilename("1.png").c_str());
This is the console output:
fpff = /Users/javier.fuchs/Library/Developer/CoreSimulator/Devices/68F9EE6B-2829-420E-9359-00EC30C6372D/data/Containers/Bundle/Application/E586FE31-AFC2-4052-9826-9B27AA75182A/MyCppGame iOS.app/res/medium/1.png
Please make sure where is the file, and take a look of the full path, inside the project.
There is no guaranty with search paths, even if you doing:
auto& list = fu->getSearchPaths();
for( const auto &item : list) {
CCLOG("%s", item.c_str());
}
You will see that adding a relative path that does not exist, the relative path will be included anyway.
This is kinda silly but I can't seem to find the directory path for the included folder.
In Flash Cs6 publish setting, I included a folder which is located at c:\abc\def\ghi/xxx.
In this case, the path in iOS will be app://xxx?
To access a flle in the folder, what string do I exactly need to pass to the URLRequest?
I think you are trying to access applicationDirectory. In iOS standard directories native path like
app:/ means applicationDirectory
applicationDirectory - /var/mobile/Applications/uid/filename.app
applicationStorageDirectory - /var/mobile/Applications/uid/Library/Application Support/applicationID/Local Store
However you can access application directory file like
var applicationXMLFile:File = File.applicationDirectory.resolvePath("application_data.xml");
var applicationXMLUpdateFile:File = new File(applicationXMLFile.nativePath);
if we are trying access directly like
var applicationXMLFile:File = File.applicationDirectory.resolvePath("application_data.xml");
Sometimes it throws SecurityError/IOError.
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7d9e
Using a File.
If you want pass to URLRequest iOS Documents folder path.
try this:
var urlRequest:URLRequest = new URLRequest(File.documentsDirectory.resolvePath("myFile.txt").nativePath);
i have an audio file test.mp3.
when the file located in "Documents" folder, and i create my media object like this :media = new Media('documents://test.mp3'); Everything works fine.
but when my audio file located in a subfolder in "Documents" folder, say "Documents/data", and i create my media object like this: media = new Media('documents://data/test.mp3'), i have this error in console: Failed to initialize AVAudioPlayer: (null) . And error code = 4
My question is, how can i play an audio file located in a subfolder in "Documents" folder
Edited:
It is fixed in phonegap 1.3.0
Using phonegap 1.7, just provide the name of the file without any schema. According to the Cordova source code if you don't prefix with any schema (like documents/file) it is relative to your www fold
media = new Media('test.mp3');
Assuming you have www/test.mp3 file in your project