delete-file

How to delete a client side file using PHP?

混江龙づ霸主 提交于 2019-12-14 04:00:01
问题 I have a PHP app and I need to delete a client-side file. How can I achieve that? I'm new to PHP. Hope someone can help me. 回答1: You can't, browsers won't allow it, full stop. You could if you wrote a browser/ActiveX/Java plugin that has that kind of access and got the user to install it, but please don't . 回答2: You can't do this for obvious security reasons. PHP is server side only. 来源: https://stackoverflow.com/questions/4011792/how-to-delete-a-client-side-file-using-php

JQuery-File-Upload 404 Error on Delete

给你一囗甜甜゛ 提交于 2019-12-14 03:16:56
问题 I installed JQuery-File-Upload (and Backload) using NUGET into my VS2013 MVC 4.5.1 project. The file upload works great and I successfully uploaded 3 files. However, when I attempt to delete any of the files, nothing appears to happen on the page and Fiddler reports a 404 error. Moreover, all the files exist and the folder and files within them have been set to EVERYONE with full control. Also note, the message below specifies a path for backload's handler, but, the path doesn't exist ...

Delete all files older than 1 day / 24hours using creation date?

北慕城南 提交于 2019-12-14 03:03:51
问题 I want to delete all files older than 1 day / 24 hours using a timed task in the OS and a batch file. This is needed for a simple backup mechanic I've implemented, that saves a certain file every hour and I don't want to delete old files manually. I already implemented the following batch code, which successfully create a backup every hour. However, the delete portion of the code doesn't seem to work. Does anyone have any suggestions as to why? PS: I'm using Win7 x64. Code: rem Get day of

What is better way to delete file with condition

老子叫甜甜 提交于 2019-12-13 08:36:39
问题 I want to build a win service(no UI) on c# that all what it done is: run on list of directories and delete files that over then X kb. I want the better performance, what is the better way to do this? there is no pure async function for delete file so if i want to use async await I can wrap this function like: public static class FileExtensions { public static Task DeleteAsync(this FileInfo fi) { return Task.Factory.StartNew(() => fi.Delete() ); } } and call to this function like: FileInfo fi

.obj to .cpp converter?

ぐ巨炮叔叔 提交于 2019-12-13 02:37:29
问题 Is there any .obj to .cpp converter? Is it possible to do it? MICROSOFT VISUAL STUDIO auto-magically deleted my code files when pressed the F5 key. Please help me. I have the .obj files (VS forgot to delete them.ha ha ha). 回答1: Unfortunately it is impossible to decompile an .obj file back to source. More info here. 回答2: shut down your computer, boot from removable media, some sort of the UNIX, and run strings utility on your hard drive. It may be able to recover text off your source code. 回答3

Delete files that match regex

那年仲夏 提交于 2019-12-12 19:39:36
问题 Shortest and nicest way to delete all files from directory that match certain regex in Perl on Windows. My example: delete all *.txt files from directory, but leave tmp.txt ? Windows. 回答1: # glob gets the names of all .txt files # we apply grep to remove tmp.txt from the list @files = grep (!/^tmp\.txt$/,glob('*.txt')); # delete the files unlink @files; 回答2: chdir $dir or die $!; unlink grep { $_ ne 'tmp.txt' } <*.txt>; 回答3: While not perfect, maybe something long winded will help. use strict

AWS Lambda No Space Left on Device error

点点圈 提交于 2019-12-12 16:07:23
问题 I am using API gateway to call lambda function that imports a mpeg file (10 mb) from s3 and saves in /tmp folder of lambda and the lambda uploads it to external API (youtube etc) Recently the API gateway call to lambda is failing intermittently with error [Errno 28] No space left on device Here is how i am downloading the file urllib.urlretrieve (s3_mpeg_url, '/tmp/{}'.format(mpeg_filename)) If i create a new version of that same lambda function and assign to alias API gateway pointing to ,

Delete files older 6 months

最后都变了- 提交于 2019-12-12 14:55:41
问题 I want delete files in a folder, which are more than six months old -older than 6 months-using Msbuild. I want use %ModifiedTime (Well-known Item Metadata) of MsBuild I prefer not use customs Tasks, only msbuild default and Microsoft.Sdc.Tasks. I use VS 2008, .net .35. Any suggestions ? <Target Name="SomeTarget"> <ItemGroup> <FilesToDelete Include="Path\**\*.zip"/> </ItemGroup> <Delete Files="@(FilesToDelete)" /> </Target> 回答1: I think you can achieve this without need to use custom tasks in

Delete File in SD Card android with string

狂风中的少年 提交于 2019-12-12 10:05:24
问题 I have this string, Cursor c = db.obtenerDatoEjercicio(selecID); String stringFoto1 = c.getString(6).toString(); then stringFoto1 is equals "file:///mnt/sdcard/Pictures/neoadnEditGyM/GYM_2.2.jpg" This file exists. I want to delete that file on the sd and I used the following code: String stringFoto1 = "file:///mnt/sdcard/Pictures/neoadnEditGyM/GYM_2.2.jpg" File archivo1 = new File(stringFoto1); archivo1.delete(); But this doesn't work, please help. 回答1: You can try using this: String strFile

Recursive delete

ぐ巨炮叔叔 提交于 2019-12-12 07:16:10
问题 I have this code to recursive delete files and directories. It works fine but has a little problem. If $path = /var/www/foo/ it will delete everything inside of foo, but not foo. I want to delete foo directory too. Any idea? public function delete($path) { if(!file_exists($path)) { throw new RecursiveDirectoryException('Directory doesn\'t exist.'); } $directoryIterator = new DirectoryIterator($path); foreach($directoryIterator as $fileInfo) { $filePath = $fileInfo->getPathname(); if(!