Can I create an application which ask for user's gdrive id and password, and than upload files from local computer to gdrive automatically? - api

Yes, I get it what I am asking for is exactly how gdrive works, in fact coping multiple files is also a simple ctrl+A and drag and drop. But still humor me, can I use gdrive API to ask for end user's ID and Password, and it uploads certain files in the user gdrive. The files it would upload is basically already hardcoded, like all the pdf files from a certain directory.
I am an undergrad student and really not familiar with the workings of API, so thank you for any and all help.

Yes you can!
Start with the quickstart on your favorite language and then reference this documentation to understand how to upload a file.
Hope this helps!

Related

Upload Excel document to shared folder on Google Drive with Excel VBA?

I have found different scripts for Java, C#, and Access VBA for uploading a file to Google Drive. But the only thing I have found with Excel VBA, is a script saving the file in your local Google Drive folder and then wait for the application to sync it.
Is it possible to somehow upload the Excel file directly to a folder that has been shared with me? If yes, how?
I actually managed to do this.
First, you need to create credentials. Follow this guide: https://updraftplus.com/support/configuring-google-drive-api-access-in-updraftplus/
The credentials should be OAuth Client ID
Application Type: Other
Secondly, I downloaded this Access VBA code found here https://stackoverflow.com/a/34627231/1042624
Afterwards, in the Access document, there will be a settings box. You need to fill in the information about your account and the credentials from step 1 here. Then you can use the upload button, and it will work.
However, if you want to use this in Excel and without the form boxes, then you have to step through the code and find where the settings form boxes´ info are being used. It takes quite a while, and the code is too long to post here. But now you at least have the information on how to do it.
NB: I still did not crack the 2-step verification that I have enabled.

Where can I upload data permanently?

assume I have some thesis etc. and want to give the audience the possibility to download the coding part and test it;
Is there a platform for professionally upload it and also keep it there permanently (of course it should not be deleted within a couple of months)
Thanks for your help...
You can use tools such as Git-hub or bitbucket. These allow you to upload code and even have version control. Users can download your code directly and use it if they need to.

How to create advance PDF file encryption and protection using php?

I have a problem about PDF file encryption using php.
Case: Let's say I have a local system (web based) to upload and download files, such as 4sh*red (dot) com, but it just allows PDF file. A user sign up and login to download the PDF files using his or her own personal computer. After users downloaded a PDF file from my system, the file can be viewed only on computer where they downloaded the file. But, if another user copy it (I mean: downloaded PDF file) to another computer, the file can't be viewed on that computer.
Note: I don't mean here about protecting the PDF files using password because nowadays there are a lot of softwares used to remove PDF's password protection. But, the file can't be viewed at all if copied to another computer.
Can we do that in php? If yes, do you know any algorithm to solve the case?
I really appreciate your response or answers.
Thank you.
The PDF format is an open format by Adobe. This means there are a lot of programs out there that can read it and quite same that can modify it.
If you write your own program and add some stuff to the PDF, then maybe you can do this.
Another question is - why don't you just make the document visible in the web browser to the user? Of course there's still going to be a way around for savvy users to get it, but most noobs wouldn't know how and you can easily close the simplest blocks (like right click / save).
What maybe interesting to do is what a lot of companies are doing with videos nowadays: you can dynamically add some hidden or visible 'info' to a PDF that identifies who you sent it to. In that way, if the PDF shows up somewhere else - you know who spread it.... Again - PDF is an open format, so anyone can always erase whatever you write in the main contents, so you'd have to add a hidden image to the content or something.

Folder locking with password

Hello can anyone explain me or give me some examples of how to lock a folder with VB.net.
I want to chose folder, set password for it and then lock it.
When i try to open that folder i want my app to popup asking for password, if password is ok then unlock folder if not do nothing.
I know how to do all except this autorun of my app when folder is accessed.
Thank you!
Your scheme as you described it doesn't mention encrypting files, and without encryption use of such "locking" is questionable.
Now, encryption or not, your only solution is a filesystem filter driver which will ask the password when the file is accessed, and then will allow or deny opening of the file (and on-the-fly encryption/decryption must be performed as well).
VB.NET can't be used to write a kernel-mode driver (you need deep knowledge of C and Windows internals and about 6 months of work to create a driver). You can use our CallbackFilter product, which provides a driver and lets you write business logic in user-mode.
on the Microsoft forum there is the following solution, maybe it's useful to you: http://social.microsoft.com/forums/en-US/softwareresources/thread/9a0f17af-928e-4732-a3ba-90d54ed961ea ; you may create the file they suggest dinamically by your software and then manage it.

File permissions on a web server?

I'm new at writing code for websites. The website allows users to upload files, such as profile pictures or other pictures. The files are saved in the unix file system and the URLs to find those images are stored in a MySQL database.
It seems like the only way I can let the user upload files is to give write access to anybody using chmod. Otherwise it complains that it doesn't have write permissions. But they shouldn't be able to write whatever they want or overwrite other users stuff. Similarly, to allow users to see images that they have rightful access to, they need read permissions on the file system. But now that means that anybody with the url to that picture can see the image too, correct? That's not what I want.
Is there a solution to this contradiction? Or am I thinking about the problem incorrectly? Thanks for any help.
You need to manage the permissions in your application and not expose arbitrary parts of your local filesystem directly to the clients. Your application should decide what files someone can see or where to write data. You should not trust data (filenames, etc) from your clients...ideally, store files on disk using systematically generated names and store human-readable names in the database.
SunStar9,
Since you are already using a MySQL database to store the URL of the image on the file system, why not just store the image itself as a BLOB (binary large object)?
This is generally a well-accepted design practice for allowing users to upload binary data to a website.
Are you using PHP, Java, Ruby/Rails, or something other to develop your website? Depending on what you are using, there could be file upload/management plugins or modules that will help you develop what you are trying to do if you are certain you want to use the files ystem for storing the image data.