02-07-2011 10:29 AM
We have a multimedia application with over 150 pictures and around 15 video clips (Around 1 minute in length). I know this is too much to embed within the application itself. I think the right way to do this is to add the files to a server and have the application access these resources over the internet. But I'm not too sure what the best way is to do this.
Our client said they can put the files on their server, but I just need to tell them if there is a specific way it needs to be done. I have never worked with a server so my knowledge of how you would do this is extremely limited. Will they need to create a new page/url for each resource file? From my research, that appears to be the case, but I have tons of resources. Is there an easier way to tackle this? I'm assuming all I need to do the application is the separate urls, right? Thanks for any information you can provide.
02-07-2011 10:36 AM
If it is anything sensitive, I would suggest having some sort of script/app on the server that will serve up the files you request. Actually it might make it a lot simpler for you to just have a base url, say: http://www.yourserver.com/get_file.php?file=FILENA
02-07-2011 10:47 AM
Thanks for the reply. They do have their own domain/base url, as this is a webserver they use to host their website. They do not want to put these resources on the website itself. So if I understand you correctly, all I need to tell my client to do is to 1) upload all the files to the server 2) write a script on the server for searching for the files 3) give me the url to the script. Is that right? Then on my application side, all I need to do to access image001.jpg is reference "http//www.server.com/script.php?file=image001.jpg". I apologize if this seems elementery, but I simply don't know anything about this. And just to verify, that means they do not need to make a separate page or anything for each resource, right? Thanks again.
02-07-2011 10:59 AM
Yep sounds like you've got it! And you are correct, doing this they can just give you the one URL and you can request the files from that instead of from multiple URLs, all you have to do is change the file= argument.
02-07-2011 11:02 AM
Do you know of a good example script I can give the client in case they need help? Or a good place to look for information on how to do this? I'm not sure how much they know about scripting or php. Thanks again.
02-07-2011 12:21 PM
I think the most important one will be the header() call in PHP http://us3.php.net/manual/en/function.header.php (if you go with PHP that is). There are a lot of good user comments on there that should help in development.
02-07-2011 12:23 PM
If you want to do this 'cheap and cheerful' and/or quickly, you don't implement a a script. Instead just get a URL that represents a directory on the Web Server and download your files directly from there.
So say their server is called
and the file is called
then you can use code like this:
to download from
I suspect that you will have files that are quite big - to make sure these a re-startable in chunks, you might want to consider this code:
Hope this helps.
02-07-2011 12:35 PM
So what your saying, I don't even need to make an extra file (html or script). Rather simply add the files to a directory? I was thinking that they needed to be on a page or something.
Assuming their server is "www.company.com". I can:
1) Create a new directory called "Pictures"
2) Add all pictures to that folder
3) In my application, if I want to access image001.jpg, all I have to do is reference "www.company.com/Pictures/image001.jpg
That would be the perfect scenario, but for some reason I was thinking there was going to be more to it than just uploading the files to the server. Did I understand that correctly?
02-07-2011 12:44 PM
What you are suggesting should work fine.
There are advantages to using a script, most notably:
a) The file location and name can change without you needing to change the BB - you just change the script
b) You might have some security restrictions so want to authenticate the download.