I've recently begun experimenting with Deployd. It is (kind of) similar to meteor.
This may be amateurish question, but what happens if my collection consists of images?
How will I upload it to MongoDB # deployd dashboard?
I created a module for deployd to upload files (images included).
https://github.com/NicolasRitouet/dpd-fileupload
It lets you store the files in a local folder and in a collection to query them.
The only real way to use the Collection Resource Type to do this right now would be to base64 encode the image and store it as a string property. There are some limitations and performance issues with base64 images though. Alternatively, #dallonf has created an Amazon S3 resource to make it easy to integrate deployd apps with S3. http://docs.deployd.com/docs/using-modules/official/s3.md
There have been a lot of requests for storing binary files in collections, and hopefully someone (core committer or otherwise) can work on this after the forthcoming deployd release which includes significant improvements to the module API. This Github issue is worth watching: https://github.com/deployd/deployd/issues/106
Related
I'm using express and I would like to pipe a POST request coming from the client directly to a writeable stream to Google Storage, in order to upload the file without storing it in memory or on the disk first. I did some research and found various examples, which seem to work. However, all the solutions I found use dependencies like multer or busyboy. For learning purposes and to avoid unecessary overheat, I'm interested in how to achieve the desired solution without these kind of dependencies. I've been searching for a while but unfortunately couldn't find any examples. Thanks for your time.
We have a React Native app that has a lot of hi-res images and videos. We are inching closer to the 100MB limit for the Play Store. What is the current solution for downloading additional assets to the device and how does ReactNative then access them? I've found some modules that can download to the device's downloads folder, but am not sure what the approach should be for actually reading those files at run-time.
For example, we want to download some additional *.mp4 files from the web, so the app has them available for display instantly.
To store files in the internal storage of the device you need to use something like react-native-fs, trying to make your own version of something like that, failsafe and tested could take some time, so it's better if you just can use that.
I am developing a web application that will manage directories and files through its web interface.
Developing a web interface is one part, and it is in advanced progress. However, I start thinking, how should I develop the server application, that will manage the files and directories based on user input.
The client will be created using standard tools:
HTML5
CSS3
JavaScript
PHP - Despite it is server side application, it will be responsible mostly for Dynamic Websites
MySQL - Despite it is server side application, it will be responsible mostly for keeping information about users, their settings, etc..
Would you advise me please, what would be a server-side programming language of choice to manage server-side file system? Is there any API available, that will allow me to do exactly what I wish? Is it possible to manage the server-side file system in server-side JavaScript, or should I chose another tool? Server-side JavaScript comes to my mind as a logical chocie, as I use it for the client side as well.
This is what I wish to achieve:
To create new directories and files
To delete directories and files
To track the directory and file size
To move files between directories
To provide content of the directories and subdirectories
Ideally, the solution should be platform independent and should work on both, Linux Ubuntu and Windows Server OS.
I understand that my question is a bit broad. I would be thankful, if you point me to the right direction, which technologies to start studying, to be able to accomplish the above mentioned.
Thank you.
You already have a very capable serverside language in your list. PHP.
PHP can do all of the things you listed above... and a few you didn't list as well :)
To create new directories and files
New files can be created with the touch() function, and new directories with the [mkdir()](http://php.net/manual/en/function.mkdir.php function.
To delete directories and files
Deletion is done with rmdir() and unlink().
To track the directory and file size
File sizes can be monitored using the filesize() function. Couldn't find a native folder size function but this Stack Overflow post may be useful - https://stackoverflow.com/a/478161/558021
To move files between directories
Moving files and directories can be accomplished by using the rename() function.
To provide content of the directories and subdirectories
One of the functions PHP gives us to scan folders is called glob() it glob - it allows you to find pathnames matching a pattern, so if you give it a wildcard character * it will find all the files in a certain location.
I am using Titanium 1.7.6
I am developing an android 2.2 application that will access images/videos/pdf/text from my resources folder from sd card. I want only the application to be able to read the contents of my resources folder. What would be the best way to do that?
Here are some of my ideas:
password protect the resources folder, only application would know the password. (Not sure if this can be done. If you know how to do it please let me know.)
encrypt all the files inside the resources folder. (in this approach, I am guessing in order to read an encrypted file like images, I will have to decrypt the file and store it into some temp folder. after using the decrypted file delete the file from the temp folder.) But there is a problem with this approach. please see link to the problem here
If you have some other idea please add that to the list.
I don't really have a serious experience with android developing, but here are some ideas from top of my mind which may come handy:
You can always use open-source compressing libraries such as gZip to compress and password protecting your folders using an additional library like PGP or PKZIP. this method is really common among developers. e.g: Call Of Duty games. the game, stores resources such as sprites/sounds/models/scripts and such in compressed and encrypted folders with .ff extension.
since Android uses the same code base with Linux, I think it's possible to encrypt folders in the same fashion. so try all of those encrypting techniques from Linux
And of course, when it comes to encrypting areas, one does not simply forgets about RSA and SSL like encryption/decryption algorithms
And your best option from the above methods is the first one, because:
By compressing a whole folder, you don't need to worry about files inside it
While using libraries such as gZip, with addition to a robust,fast and optimized backbone for your application you have a rich and easy-to-use API to decrypt and decompress your files and folders.
Hope it helps you.
Is it possible to list the files in a directory using only javascript? To clarify, I mean list the files on the server, not the files on the clients computer. For instance:
www.domain.com/files/
contains 4 images (.jpg)
Can I make an extra page (www.domain.com/files/list.html) that lists those 4 files using javascript?
No, Javascript doesn't have access to the filesystem. Server side Javascript is a whole different story but I guess you don't mean that.
Very late to this party, but my google search for this exact request led me here.
The answer is "not really", but I've found the frankenstein of hacks elsewhere: If +Indexes is (or can be) enabled in the .htaccess for the folder containing the files you want to list, then use XMLHTTPRequest with the folder name as the url (which will return an html page listing the files).
I don't know if you architecture allows it but ikf you can install and use node.js as its node API mentions, you can interact with the filesystem by requiring the fs module.
This is the environment Node.js relies on:
Node eventually wants to support all
POSIX operating systems (including
Windows with MinGW) but at the moment
it is only being tested on Linux,
Macintosh, and Solaris. The build
system requires Python 2.4 or better.
V8, on which Node is built, supports
only IA-32 and ARM processors. V8 is
included in the Node distribution. To
use TLS, OpenSSL are required. There
are no other dependencies.
You can run It side-by-side with another web app. and this will avoid blocking your web application if the interaction with the filesystem takes too long.
It is generally not a good idea to access client computer files via javascript for security reasons, however i suspect you can use the File System Object for that. I am not sure about browser-compatibility for that, it should work in IE only probably though.
You need to use server-side languages such as PHP, ASP.Net, JSP, etc
JavaScript runs inside a host environment. So if the host provides a facility to list files in this manner, then yes. But in the typical scenario where JavaScript is running in a browser with default configuration, no.