Use-case question for average phone users re: file-sharing

This is going to seem like a really strange question, but hear me out....

Suppose you're writing a web app for something people will typically run on their mobile devices (phones and tablets). Your app is going to have some audio files on it for them to listen to. You can provide a variety of things for them, but you KNOW that people are eventually going to ask, "I've got this one song I really like that I'd love to use for this; how can I upload it?"

On a desktop or laptop running Windows, MacOS, or Linux, the answer is simple.

But I'm having a hard time answering that question when it comes to mobile devices -- not for the reason that's obvious to most programmers, but because of two conflicting issues: (1) it's a web app, and on a mobile device, it cannot access the local file system; and (2) even if it could, most users have no idea where their media files are located there, even if they ARE there. The thing is, many people use streaming services like Pandora or Spotify, and have no idea where the music files they listen to actually live -- that's why they're called streaming services.

Personally, I have a microSD card that I loaded up with a ton of music files and put in my phone (most Android phones let you do that, Apple products don't). I copied the files to a small thumb drive and plugged that into the USB port in my car so I can listen to them there. This saves me from having to subscribe to Satellite radio or some streaming service, or pay for iCloud / iTunes hosting. But I do have access to the files. I don't know how that works for people with iPhones. (I have an iPad, but I don't listen to music on it.)

So if I had a song on my (Android) phone (in the SD card) that I wanted to upload to your web app, I know where it lives, but I don't know how I'd get it to your app. If I had an iPhone, I don't even know where it lives.

The obvious questions are: do they have the ability to download the music file from somewhere else that they want to hear in your app? (Ie, is it accessible via a web browser?) If so, where can it be saved to? And then, how do they upload it (considering that they can't access the local device's storage)?

It's basically a file-sharing problem at this point. "I have this spreadsheet I'd like you to look at, can I send it to you?" Ok ... how?

In my mind, the easiest solution would be to put the file on Dropbox or Google Drive and get a DL URL for it, then paste that URL into a field in your app and press the [OK] button. It's a workable soluition ... IF it's not blocked by a CORS policy. (My remote service can try to DL the file, but my experience lately is that it will very likely be denied access to it.)

I'm hoping some folks here have faced this problem in some way or another and have either come up with a solution or have seen something that has worked. Because I'm rather stumped at this point.

Think of it this way: You're creating this web app, and you have a few friends who are total technophobes but they like your app, and they want to know how to upload a favorite song so they can hear it in your app on their iPhone or Android phone.

How do you solve that problem in a way that's simple enough for them to deal with, other than taking it to the Geek Squad at Best Buy? (Or calling you.)

I'm looking for some ideas here...

IDEA: It's a web app, so it can be run on a desktop or laptop. Does that offer a solution? (As opposed to having to do it from their mobile device.)

On iOS (Safari in more general) this is already problematic at browser level, it needs enabling to begin with:

Am I correct in assuming that accessing the local file system is not a problem when running in Windows, MacOS, or Linux? (So I could just say to upload their files that way?)

In HexaGongs Part 4, I went over a few approaches to loading up audio files. I've not had a chance to test it exhaustively, but I was able to load a WAV file using an iPad, using the "choose file" option that appears with the TWebOpenDialog component. This is equivalent to a "local file" - it uses Apple's "Files" app which is its way of handling this kind of thing.

Annoyingly, using the "audio/*" value for the "access" property on that component doesn't allow loading WAV files on iOS for some reason, so the list of extensions was provided explicitly.

Recording iOS audio doesn't seem to work (TWebMediaCapture) but I've not spent any time trying to figure out why as yet. Everything seems to be there (it prompts for microphone access, etc.) but the OnStopCapture event doesn't seem to fire so I don't get any data. But I have to investigate a little more before posting a support request about that. Works fine on Linux/Windows though.

This is not something I expect users will want to do very frequently, so I just need something that's simple and workable. If WEB Core lets my app offer a way to open files from the file system in Win and Mac, then send them somewhere where they can find them later (my cache area), that would be sufficient. I'll just say that's how it needs to be done. (Not from iOS or Android.)

Does TWebOpenDialog not work for your purposes, across all platforms?

I haven't tried yet. I JUST got the dang remote service to respond from the VNC host it's in! I had to configure IIS and figure out a bunch of stuff that's shut off by default. Grrrr....

I've set up lots of Debian servers, and it's so damn simple. You just answer a few questions and then you point your latptop's browser to it and viola! It's up and running! Windows Server ... makes you wonder why they made it...

It is a bit of a curiosity that bad operating systems thrive and good operating systems languish. Seems to be one of those immutable laws of computing.

1 Like