Welcome! Log In Create A New Profile

Advanced

WD Mobile v28 IOS upload files - Solved

Posted by cabinetman 
WD Mobile v28 IOS upload files - Solved
December 22, 2023 02:45AM
Hello All,

I was asked to have an app that uploads files to a server.

While doing the research I can not see a way of just selecting a file from the devices to upload. How would the file path of a file be captured?

Ant suggestions of how a file picker would be created?

Thank you,
DW



Edited 1 time(s). Last edit at 01/08/2024 04:04PM by cabinetman.
Argus
Re: WD Mobile v28 IOS upload files
December 22, 2023 12:54PM
The real problem is 'PERMISSIONS'
Modern mobile OS are blocking most drive access to regular applications, for security reasons

Otherwise, that is done using flistfile and flistdir.

It would probably be easier to create a web page with an upload button for your goal.
Re: WD Mobile v28 IOS upload files
December 22, 2023 09:04PM
Hello Argus,

That was my next thought but wouldn't you still need a file path, How would this work different?

DW
Re: WD Mobile v28 IOS upload files - Solved
January 08, 2024 04:04PM
Hello All,

The equivalent to fSelect in windows is URISelect on IOS/Android.

// Open the system window to select a PDF or image. You must use a call back procedure on IOS.
URISelect(MyProcURISelect, uriImage + TAB + "application/pdf")


//Call back procedure
INTERNAL PROCEDURE MyProcURISelect(Success is boolean, PathResult is URI)
		IF Success = True THEN
			sReturnURI = PathResult
			// Displays the name of the selected resource
			ToastDisplay(URIGetInfo(PathResult, uriInfoName))
			gsURL				= PathResult

                        //Get the File name
			sFileName			= URIGetInfo(PathResult, uriInfoName)
			
                        //Gets the file extension
                        sExt				       = URIGetInfo(PathResult, uriInfoOriginType)
			sExt				       = ExtractString(sExt,2,'Tab')
			sConVertExt			= URIGetInfo(PathResult, uriInfoConversionType)
                        sConVertExt			= ExtractString(sConVertExt,2,'TAB')

			//Gets the file size
			nSize				= URIGetInfo(PathResult, uriInfoSize)
			
                       //Save it in the app folder so I can change the name and send it to the server
			IF NOT ErrorOccurred THEN
				// Save the resource in the application directory
				URIToFile(sReturnURI, sFileName+sConVertExt, ProcSave)
			END
			
		END
	END

Thank you,

DW
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: