createfile

PHP create file for download without saving on server

六月ゝ 毕业季﹏ 提交于 2019-11-28 04:41:44
Ultimate goal: I want to create a webpage where a user can enter information in forms. With that information I want to create a html file (below called test-download.html) by inserting the information given into a template and then force a download. Since I want to demonstrate this at an upcoming workshop where people will be using this at the "same time" I would like to not save the file on the server and just force the download. So far: I have this in my html file (test.html): <form action="test.php" method="post"> To file: <input type="text" name="tofile" /> <input type="submit" /> </form>

How can I create text files with special characters in their filenames

六眼飞鱼酱① 提交于 2019-11-28 00:31:00
Demonstration of my problem Open a new Excel workbook and save these symbols 設計師協會 to cell [A1] insert the following VBA code somewhere in the editor ( Alt + F11 ) execute it line per line ( F8 ) Sub test() strCRLF = StrConv(vbCrLf, vbUnicode) strSpecialchars = StrConv(Cells(1, 1), vbUnicode) strFilename = "c:\test.txt" Open strFilename For Output As #1 Print #1, strSpecialchars & strCRLF; Close #1 End Sub You will get a textfile which contains the chinese characters from [A1]. This proofs that VBA is able to handle unicode characters if you know the trick with adding StrConv(vbCrLf, vbUnicode

cannot convert parameter 1 from 'char' to 'LPCWSTR'

≯℡__Kan透↙ 提交于 2019-11-27 12:04:51
I keep getting this error: cannot convert parameter 1 from 'char' to 'LPCWSTR' int main(int argc, char argv[]) { // open port for I/O HANDLE h = CreateFile(argv[1],GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); if(h == INVALID_HANDLE_VALUE) { PrintError("E012_Failed to open port"); can someone help? It should be int main(int argc, char* argv[]) And HANDLE h = CreateFileA(argv[1],GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); Go to the Properties for your Project and under Configuration Properties/General, change the Character Set to "Not Set". This way, the compiler will

How to create empty folder in java? [duplicate]

我的未来我决定 提交于 2019-11-27 09:30:42
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: How to create a folder? I tried to use the File class to create an empty file in a directory like "C:/Temp/Emptyfile". However, when I do that, it shows me an error : "already made folder Temp". Otherwise, it won't create one for me. So, how do I literally create folders with java API? 回答1: Looks file you use the .mkdirs() method on a File object: http://www.roseindia.net/java/beginners/java-create-directory

Figuring which printer name corresponds to which device ID

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 05:52:33
问题 My goal is to open a printer connected via USB using the CreateFile (and then issue some WriteFile s and ReadFile s). If the printer was an LPT one, I would simply do CreateFile("LPT1:", ...) . But for USB printers, there is a special device path that must be passed to CreateFile in order to open that printer. This device path, as I was able to find, is retrieved via SetupDiGetClassDevs -> SetupDiEnumDeviceInterfaces -> SetupDiGetDeviceInterfaceDetail -> DevicePath member and looks like this:

PHP create file for download without saving on server

六眼飞鱼酱① 提交于 2019-11-27 00:35:51
问题 Ultimate goal: I want to create a webpage where a user can enter information in forms. With that information I want to create a html file (below called test-download.html) by inserting the information given into a template and then force a download. Since I want to demonstrate this at an upcoming workshop where people will be using this at the "same time" I would like to not save the file on the server and just force the download. So far: I have this in my html file (test.html): <form action=

How can I create text files with special characters in their filenames

天涯浪子 提交于 2019-11-26 21:44:14
问题 Demonstration of my problem Open a new Excel workbook and save these symbols 設計師協會 to cell [A1] insert the following VBA code somewhere in the editor ( Alt + F11 ) execute it line per line ( F8 ) Sub test() strCRLF = StrConv(vbCrLf, vbUnicode) strSpecialchars = StrConv(Cells(1, 1), vbUnicode) strFilename = "c:\test.txt" Open strFilename For Output As #1 Print #1, strSpecialchars & strCRLF; Close #1 End Sub You will get a textfile which contains the chinese characters from [A1]. This proofs

cannot convert parameter 1 from &#39;char&#39; to &#39;LPCWSTR&#39;

核能气质少年 提交于 2019-11-26 15:53:54
问题 I keep getting this error: cannot convert parameter 1 from 'char' to 'LPCWSTR' int main(int argc, char argv[]) { // open port for I/O HANDLE h = CreateFile(argv[1],GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); if(h == INVALID_HANDLE_VALUE) { PrintError("E012_Failed to open port"); can someone help? 回答1: It should be int main(int argc, char* argv[]) And HANDLE h = CreateFileA(argv[1],GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); 回答2: Go to the Properties for your Project

寻找最快的大文件拷贝方法

和自甴很熟 提交于 2019-11-26 15:13:56
  众所周知微软的操作系统自带的拷贝是很“弱智”的,速度不高,无断点续传,而且拷贝会拖累其他的应用程序,占用大量的文件缓存。所以很多高级的拷贝工具孕育而生,用过最好的是FastCopy。FastCopy的拷贝速度基本上可以达到磁盘的极限,还因为他开源,所以可以看到其实现。但是很可惜他的工程是VC6的,而且源代码注释都是日文的,不仅如此,其源代码风格很让人迷惑。证实了我的那句话:开源软件的最高境界就是,我开源了,你看不懂;等你看懂了,已经过时了。   要达到最快的拷贝速度和减少对内存的占用,需要对拷贝的过程有一个了解。拷贝无非就是将文件的数据读出来,然后再写进去的一个过程。XP操作系统自带的拷贝工具会首先打开文件句柄,然后将一块数据读取到缓存中,然后再写入到磁盘中。打开“Windows任务管理器”,进程,查看,选择列,打开I/O读取字节,I/O写入字节。拷贝一个文件,注意explorer.exe进程即可看到整个读写过程。基本上可以看到XP对于文件拷贝几乎是属于同时进行的,换句话说其开的缓存比较小,但其效率可能并不见得很高。在我的200G Seagate 7200.8硬盘上,复制速度在15M/s左右。而这个硬盘的平均读取速度在40M/s,平均写入速度也在35M/s以上。   在Vista下面文件拷贝做了一些优化,虽然一些BUG导致复制小文件会感觉很慢