Clear Google Drive Folder - directory

Good afternoon,
I need help with cleaning a folder from my Corporate Google Drive.
I have this script below that cleans the folder when run by me, but it doesn't happen when another corporate user runs the same!
Receives Access Denied Error: Drive App
var folder = DriveApp.getFolderById("id folder")
var files = folder.getFiles()
while (files.hasNext()) {
files.next().setTrashed(true)
I appreciate if you can help me, I'm new to scripts

Related

Access to folder is denied

In my app i created folder “.app/” where users keep their uploaded files. I made such a name (with dot) to prevent meteor watch this folder. Because otherwise when user creates new folder server reboots.
But when I’ve deployed my app It crashes when user tries to create folder.
“Access to .app folder - denied”.
How can I solve this problem?
Usually the docker file system is read-only for the meteor process, which is why it fails. If you really want local file acces (not a great idea anyway, think about using Filestack or an AWS S3 bucket instead), well you will need to add a volume which is writeable, and will survive a docker image being blown away (which you occasionally will need to do).

Files on network drive are not accessible when website is published on IIS

I have a website that shows a list of recommended documents retrieved from a network drive, Z drive. for each document, if the user pushes a button, he can navigate to the path of the file through windows explorer. below is the code.
string argument = #"/select, " + filePath;
System.Diagnostics.Process.Start("explorer.exe", argument);
an example of filepath is : z:\ecomarathon2012\04-Reports\fuel cell and batteries comparative.docx
Now, I have published the website on IIS but the button does not work anymore to show me the path of the file.
What changes I need to add in order to solve this problem for the published version of the website?
Sounds like your IIS user identity doesn't have access to the network drive. Give that user read access and I believe your code should work. If not, try to log some errors using try catch and post them here.

ASP.NET How to open a folder at server side?

I'm trying to open folder location from code behind
Process prc = new Process();
prc.StartInfo.UseShellExecute = true;
prc.StartInfo.FileName = #"\\Shared\FolderName\test";
prc.Start();
After that I got it I couldn't achieve by using Shell32 class or Process.Start on server side as well as adding link to path cant be used because of the security problem so how can achieve this problem ?
Thanks for your help
That's right, you won't be able to launch an external process in a web application (and with good reason!). I think you need to reconsider what it is you're trying to achieve... perhaps some more information will help us give you a better solution?
A web application hosted on server can not access external file and folders on the system. This is due to security reasons. However if you want to access some specific folder, you need to create virtual directory and give path to that folder to the virtual directory. Now you can access that folder using virtual directory.
I worked on such scenario where I needed to upload file using one application (admin app) and needed to show on an other application (client app). So it works fine if you want to access outside resources.

loading css on runtime is half-failure/half-success

I have tried for my app to load fonts on request. I tried to read fonts from the a project directory which is created by my app, and it reads all the info it needs.
First of all, I want to ask if there is a way to know if there is an app-storage:// like in adobe air, because THAT IS KILLING ME! I cannot create temporary files to be read on runtime by the app and place, for example, a style sheet with the new loaded fonts on runtime via JS.!
If there is one, please let me know!!!
Now a very dirty solution. This is what I had done up to now:
Just to let know everybody, my solution relies on :
run the app as administrator (a must to have)
softlinking the user's project font folder.
now lets get the facts:
webkit cannot render fronts coming from a "file:///" url
I had tried using file:/// with no success, and neither converting the SVG fonts to base64 did the trick at all. Trying to do on runtime stylesheets was even worse, so looking for solutions I had to rely on command prompts. For now I'm running this on windows and works pearls:
var WinDoExec = function(cmdline){
var echoCmd = ["C:\\Windows\\System32\\cmd.exe","/C"];
echoCmd = $.merge(echoCmd,cmdline);
console.log(echoCmd);
var echo = Ti.Process.createProcess(echoCmd);
echo.setOnReadLine(function(data) {
console.log(data.toString());
});
echo.stdout.attach(echo.stdin);
echo.launch();
};
so from here, I had to create a mklink (soft link on ntfs) from the user's project font folder to the application font directory, so it could be accessible on runtime.
WinDoExec(["mklink","/D","C:\\Program Files(x86)\\myapp\\Resources\\assets\\fonts\\userfonts","C:\\Users\\windowsuser\\projectAppFolder\\ProjectName\\Fonts"]);
with this, creating a soft link into the application in runtime fixes the issue of loading the custom fonts for the user's project into the runtime app...
I know this is kinda "abusive" with the program environment, but I really wish there was a way for the app to have a url accessible path (such storage url path or temporary url path) in order to process things on runtime. I could copy the fonts into the temporary url container folder and do my stuff without affecting the app system folder at all.
So if you guys on tidekit read this, please allow developers to have accessible url paths for temporary objects (like user's svg/ttf files) that I can copy there and use on runtime.
Thanks.

Downloading files

I am using asp.net/C#. I have a url to a folder on a remote server. In that folder are images that are all .jpgs. I don't know the names of the files, just that they are all .jpgs. How do I download all the .jpg images using asp.net/C# to a folder on my local hard drive.
Just to clarify. I am pulling files from a remote server and I am saving them to my local machine. I was given a web URL and told that the files I needed to pull down every night where .jpg image files. That's all I was told. I have no idea how I can get a list of files on a remote server with just the url to the folder.
Thanks
If it's a web URL, you'd have to depend on the web server giving you some sort of list of files. The format of the list could be almost anything.
Put it this way: using a browser or anything else, how would you as a human find out all the filenames?
Just to clarify, are you writing code on the server which has the files? If so, you can find out what files are present using Directory.GetFiles. What do you want the user to have to do at the local side?
If you could make your question a bit clearer it would really help.
Here is some concept code to work with
DirectoryInfo di = new DirectoryInfo("M:\MappedDrive");
FileInfo[] rgFiles = di.GetFiles("*.aspx");
foreach(FileInfo fi in rgFiles)
{
Response.Write("<br>" + fi.Name + "");
}

Resources