Organize uploads structure in Yii2 advanced template - yii2

I use Yii2 advanced template. I am curious to how to correctly set uploads structure on server.
What I need:
Users will upload files on server from frontend. I need to view this
images in backend.
At the same time, other users must have no access to uploads folder
(not able to see images of other users).
How better to store images in such case?

Related

Upload video file (mp4,mpeg) in access database using vb

is it possible to upload video file using access database and vb? i am beginner in programming and our project is all about uploading files. Can anyone help me? I used access database because that is the requirement.
Would the video files be uploaded to a local network server or to a website?
If you are uploading the files to to a local server, you could have access:
1 Open up a file dialog to browse to the file to be uploaded.
2 Copy that file to a specific directory on your network, making sure the filename is unique or possibly creating a file name based on the original file name and date of upload. ie filename_datetime.
See the following answer for steps 1 and 2: storing large numbers of images in ms access
3 Maintain information in a table with fields for: filename, file location, user, upload date, friendly file name and possibly links to other tables such as clientID etc.
If you are uploading the files to a web server, you could do this in access, but you'd probably be better off managing the uploading and listing of files in a website. You could build it yourself or look into what you already have, as many content management systems will have this kind of file management built in.

Serving local file:/// links and AppCache

I'm making a webapp for members of my caving club to search through and view cave survey note PDFs. It works fine, and I got the AppCache working for the web version of it.
However, since the PDFs are quite large and slow to download, and many members have the PDFs on their local machines from the same SVN the website gets them from, it would be ideal for them to be able to use a page with links to a local SVN folder of their choosing.
The design goals:
The site displays links to PDF files on the local filesystem
Whenever I add features to the site, users get them automatically the next time they open the page and they're connected to the internet
But after the first time they open the page, the site works offline.
Sadly web browsers don't appear to support this useful combination of design goals at once.
I can satisfy #1 by having users download a copy of the site, add their local SVN path in a JS, and open their local copy in the browser, so that file:/// links work.
I can satisfy #2 by having absolute links to JS bundles on the server.
I can satisfy #3 by using the AppCache.
I thought I could get clever by having the copy of the page on the local file system have <html manifest="https://myserver.com/myapp.appcache">, but unfortunately Chrome doesn't seem to allow a local file to use an app cache manifest hosted on a server, for seemingly no good reason to me.
Does anyone know of another way I could satisfy all 3 goals?
Perhaps there's some simple program/config I could give my friends that would intercept web requests to https://myserver.com/some/folder and instead serve them out of a folder on their local file system?
Andy,
I know this post is a bit old but came across it looking for something else related to AppCache. My understanding it that the html page and the manifest must reside in the same domain for it to work. So I think you need to modify your design:
Create a JavaScript function that acts as a setting for the user to enter the path to their local copy of the PDF's. Store this information in localstorage.
Create a html template page for the document links.
Create a JavaScript function that populates the html template page with any documents and links the user enters.
This way, the users visit your application online and it uses appcache to store itself and the JS files for offline use. To access the PDF's, the user clicks a settings button that launches a page to collect path information and saves the information in localstorage. The users can then access the template page which will populate with the documents they entered.
Here is a good intro to localstorage: [http://www.smashingmagazine.com/2010/10/local-storage-and-how-to-use-it/]

Abobe Air/Flex 4.6 Remote File Viewer

I have a Air/Flex desktop application and I'm trying to create a component within the app that can view files on the web server is is already connected to. It just needs to access one particular folder that will contain PDFs, Images & Word documents. I also want the ability to click on the files and having them open in their default desktop applications.
Is this possible and how would I go about doing this?
It's possible but not with your Flex/AIR app alone. It cannot view files/directories on server by itself but it can communicate with your server via webservices, AMF, or any other back end based service. Typically the back end reads the folder and send this information to your app. Your app can open those files in corresponding app but only if those files are available on disk so your app will have to download them prior to opening them.
Every Application has different needs but I myself usually save anything to a desktop or you can use the App storage container as well. As I use only the desktop I download what is needed OR been asked for, and the visitor has the choice of keeping it or if not needed it gets automatically deleted! this way you can use whatever PDFs, Word, Images etc. use read and write (re-write) as well as creating PDFs on the fly with Images, text etc, and that way a visitor also can print directly at his or her own leisure. regards aktell

Offline Form Submission - Data SYnc

We have a Loan Management System, and as everybody knows there is Field Investigation like Residence, Office, Business Verification.
So we have a requirement to actually support offline data entry also.
Meaning, the Field Investigation officer may download the "template" in his mobile or and the save data. Later when he is connected to App, he can sync that data.
As of now in our web application, we have JSP pages to render above specific forms.
1.) How to pragmatically download the template or html content.
2.) Save the form data in local DB or say browser db
3.) Then later sync that Json data with relational DB.
Best is to download the jsp content from ajax request, then process it's html content and through HttpClient get the response for each and every url's (javascript, css) included in the package.
Zip it and then make it downloadable through browser.

How to make a web based file uploader which monitors a local folder

I have a java swing based UI which I use to monitor a filesystem folder. Anytime a new file is added to the folder, i upload it onto my web server.
I'd like to drop the java interface and go for a web app with a simple file uploader UI where the user can see the files being upoaded and which were uploaded.
The workflow;
User open browser. Opens the web app page. Browses and selects the local filesystem folder which needs to be monitored. Over the hours as the new files are added to the local folder, they are shown in the web interface and get uploaded onto the server.
My question is what all technologies can i use to implement this. I already have the HTMl based web Ui ready. I now need to monitor(/sync?) a selected local folder. what all do i need to do that. I remember there was something created by google which allowed a background process to monitor folders.
regards
To my knowledge I do not think its possible from the browser because of security concerns. You'll need to rely on client software. You could provide your Java app as a software, similar to Dropbox.