filenames

Split Filename Up to Define Variables

感情迁移 提交于 2019-12-13 04:47:13
问题 I have a script I created to help with converting a video then uploading it to our website. Our videos all have a standard format for their filename to help with setting them up correctly (day, month, year; i.e. 09OCT2013.m4v). They get filed into directories from year to month to day (i.e. 2013/oct/09OCT2013/09OCT2013.m4v). Right now, my script opens by asking for user input for the year then month then the actual file name for the folder. What I want to do is take the file that has already

does utf-8 encoding messes file globbing and grep'ing?

给你一囗甜甜゛ 提交于 2019-12-13 04:29:54
问题 I'm playing with bash, experiencing with utf-8 encoding. I'm new to unicode. The following command (well, their output) surprises me : $ locale LANG="fr_FR.UTF-8" LC_COLLATE="fr_FR.UTF-8" LC_CTYPE="fr_FR.UTF-8" LC_MESSAGES="fr_FR.UTF-8" LC_MONETARY="fr_FR.UTF-8" LC_NUMERIC="fr_FR.UTF-8" LC_TIME="fr_FR.UTF-8" LC_ALL= $ printf '1\né\n12\n123\n' | egrep '^(.|...)$' 1 é 12 $ touch 1 é 12 123 $ ls | egrep '^(.|...)$' 1 123 Ok. The two egrep filters lines with one or three characters. Their input

Batch script that replaces static string in file with filename

ぐ巨炮叔叔 提交于 2019-12-13 04:16:07
问题 This question was migrated from Unix & Linux Stack Exchange because it can be answered on Stack Overflow. Migrated last year . I have 3000 files in c:\data\ , and I need to replace a static string in each of them with the name of the file. For example, in the file 12345678.txt there will be some records along with the string 99999999 , and I want to replace 99999999 with the filename 12345678 . How can I do this using a batch script? 回答1: try this, replace_string="99999999" for f in *.txt; do

Django FILES upload: path and filename

有些话、适合烂在心里 提交于 2019-12-13 02:13:16
问题 When an uploaded file is received by the Django server, its name can be read using UploadedFile.name If filename in the multipart-data content contains a path like: '/a/b/c', UploadedFile.name seems to contain '/c' . How can I retrieve the full path and not just the file name. Thanks. Laurent Luce 回答1: You can't. Many browsers won't ever send the whole path, as a security measure to prevent information leakage. What's more you know nothing about the file and path naming conventions in force

BizTalk 2010 Dynamic FTP Send Port Output Directory and File Name Issue

一世执手 提交于 2019-12-13 02:06:10
问题 I have a rather complex requirement - that I have to drop a very specifically named file in an FTP location, and the trick here is that I would often have to drop it into a new location and with a new file name each time (both directory name and file name depending on the year, month, date and time). Obviously, for this purpose I chose to use a Dynamic Send Port, which I have configured using a MessageAssignment Shape. A file will be generated each day. I need to drop it in a remote location

How can I modify the filename suffixes of uploaded files in WordPress?

耗尽温柔 提交于 2019-12-13 00:30:04
问题 I was wondering if it is possible to modify the way WordPress handles image uploads. If I upload an image now, the default filenames for the various sizes include the dimensions, something like the following: image-100x100.jpg , image-300x300.jpg , image-600x600.jpg , and image.jpg . While this may be useful in some cases, I need these file names to be a bit more versatile, something like the following: image-thumb.jpg , image-medium.jpg , image-large.jpg , and image.jpg . Does anyone have

Export to word with a filename doesn't seem to work

别等时光非礼了梦想. 提交于 2019-12-13 00:10:22
问题 I export a datatable to word, when I pass a file name it doesn't seem to get the file name in Open/Save dialog box. Here is what I am doing public static void Convertword(DataTable dt, HttpResponse Response,string filename) { try { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=" + filename + ".doc"); Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.word"; System.IO.StringWriter

Find the filename with highest number in a folder

北城余情 提交于 2019-12-12 20:13:42
问题 I have a folder with a lot of files, they're named based on a pattern with an iterating number in it. I'm trying to save new files through vb.net . The aim is to name it with the highest number of the folder +1 There for I looked on internet and found a lot of things about regex and Linq which helped me to make the following code : If tmpFileName.Contains("%num%") Then Dim lastFileNo As Integer = 1 Dim tmpFName = Dir(frmMain.saveLocalTFPath & "*.docx") Dim numbers() As Integer = Regex.Split

Get Filename from Byte Array

六眼飞鱼酱① 提交于 2019-12-12 19:53:58
问题 We can extract the mimetype from byte array, e.g., by using Apache Tika. Is it possible to get Filename from Byte Array. 回答1: No. You can take a guess at a mimetype from the content data itself, but the filename is not in there. 回答2: The header field that you may be looking for is called Content-Disposition. If you're downloading an attachment, then there may be a file name in that field: Content-Disposition: attachment;filename=abc.txt But there's no guarantee that you'll have such a file

can i use the function md5_file to name files when upload without having conflict with names?

笑着哭i 提交于 2019-12-12 19:08:02
问题 all the idea i need to be sure that the file doesn't saved more than one time and don't lose any file because if tow files get the same (md5) the second file will not saved (my goal don't save the same file Twice on hard disk) In other words, if one user upload image and after that another user upload the same image i need to don't save the the second image because it's already exist in the hard disk all of this because i need to save space on my hard disk this is my code it works fine