file

Download file from a regular site via proxy c#

I need to be able to download some file from a regular site using my proxy server, I already try this: System.Net.WebClient client = new System.Net.WebClient(); client.Proxy = new WebProxy(ip, port); client.DownloadFile(url); but it's not works at all, I don't know what I missed,(without a proxy it works) thanks, Dani. ...

how to rename or change file name case on the same location in objective-c

Hi, I am working on application which required me to change the filename case retaining the original filename as it is For Example: need to change abc.txt => (ABC.txt or Abc.txt or abc.TXT or abc.Txt) filename as well as its extension can be change in same way. I tried to use the NSFileManager - (BOOL)movePath:(NSString *)source toPath...

Bash script: regexp reading numerical parameters from text file

Greetings! I have a text file with parameter set as follows: NameOfParameter Value1 Value2 Value3 ... ... I want to find needed parameter by its NameOfParameter using regexp pattern and return a selected Value to my Bash script. I tried to do this with grep, but it returns a whole line instead of Value. Could you help me to find ...

How do I accept a file upload on Mechanical Turk?

I have a HIT on Mechanical Turk that requires a file upload of an MP3 file. <h2>Upload your file here</h2> <input type="file" name="audiofile" /> <input type="submit" /> When I review the results from my HIT, mechanical turk will give me the filename but no upload path or link to download the file. How can I download the file that ...

How to generate Thumbnails with phpThumb and save it into a file?

Hi all, i wan't to know how to generate thumbnails with phpThumb Class, with an array with file paths already. And then Save the result of each image on other path but with the same name. Thank you all ;) EDIT: I have my code something like this: echo "A iniciar gerador de miniaturas para a área de cliente: \n"; include $wincl...

Looping through a directory on the web and displaying its contents (files and other directories) via Python

In the same vein as http://stackoverflow.com/questions/2593399/process-a-set-of-files-from-a-source-directory-to-a-destination-directory-in-pyth I'm wondering if it is possible to create a function that when given a web directory it will list out the files in said directory. Something like... files[] for file in urllib.listdir(dir): ...

How to debug move_uploaded_file() in PHP

move_uploaded_file() won't work for me anymore, it was working fine and just stopped out of nowhere. Is there a way for me to check why it's not working anymore? Here's what I currently have, but it only returns TRUE or FALSE. $status = move_uploaded_file($tempFile, $targetFile); if($status) { echo 'its good'; } else { echo 'it fail...

How to create playable FLV video from part of FLV file using FFMPEG?

So we had real FLV video file. we had devided it into 3 parts (more or less equal, not looking into structure orcontext). We have taken second part and forgot about first 2. Video contained audio and video track. mp3 and on vp6. Is it any how possible to play thsat second part after sending to ffmpeg some command? So how to (using any...

This is my current way of writing to a file. However, I can't do UTF-8?

f = open("go.txt", "w") f.write(title) f.close() What if "title" is in japanese/utf-8? How do I modify this code to be able to write "title" without having the ascii error? Edit: Then, how do I read this file in UTF-8? ...

Python list directory, subdirectory, and files

Hi all. I'm trying to make a script to list all directory, subdirectory, and files in a given directory. I tried this: import sys,os root = "/home/patate/directory/" path = os.path.join(root, "targetdirectory") for r,d,f in os.walk(path): for file in f: print os.path.join(root,file) Unfortunatly it doesn't work properly....

Why does Perl's readdir() cache directory entries?

For some reason Perl keeps caching the directory entries I'm trying to read using readdir: opendir(SNIPPETS, $dir_snippets); # or die... while ( my $snippet = readdir(SNIPPETS) ) { print ">>>".$snippet."\n"; } closedir(SNIPPETS); Since my directory contains two files, test.pl and test.man, I'm expecting the following output: . .. te...

How to instantiate a FormFile Object ?

Hello, i have a String with a path of my file and i want to instancie a new FormFile with this String. It's possible ..? My code: public ArrayList<FormFile> getFilesFromFolder(String path) { File file = new File(path); ArrayList<FormFile> vFiles = new ArrayList<FormFile>(); if (file.exists()) { File[] files = file.listFi...

VBA: Read file from clipboard

I'm trying to load a file in a VBA macro that has been copied from, say, an Explorer window. I can easily get the data from the clipboard using DataObject::GetFromClipboard, but the VBA interface to DataObject doesn't seem to have methods for working with any other formats than plain text. There are only GetText and SetText methods. I...

Glob() filesearch, question

Hi, a little question. I have this code, which is works perfect for files, but If am trying search on a directory name, the result is blank. How I can fix that? <?php function listdirs($dir,$search) { static $alldirs = array(); $dirs = glob($dir."*"); foreach ($dirs as $d){ if(is_file($d)){ $filename = pa...

Getting file path in java

Is there a way for java program to determine its location in the file system? ...

Check to see if file transfer is complete

We have a daily job that processes files delivered from an external source. The process usually runs fine without any issues but every once in a while we have an issue of attempting to process a file that is not completely transferred. The external source SCPs these files from a UNIX server to our Windows server. From there we try to pr...

MalformedURLException with file URI

While executing the following code: doc = builder.parse(file); where doc is an instance of org.w3c.dom.Document and builder is an instance of javax.xml.parsers.DocumentBuilder, I'm getting the following exception: Exception in thread "main" java.net.MalformedURLException: unknown protocol: c at java.net.URL.<init>(Unk...

I need to rename a file in VBA, but getting "File Not Found" when it's clearly there!

Help! I'm getting a File Not Found error when trying to rename a file w/a variable. The variable is string. I can look at the variable and it's the exact filename that is there, but when I run the code, it says not found! Dim filePath, fileName, absPath, newPath As String filePath = "P:\Automated\" fileName = MySite.GetResult absPath =...

Problem opening a file browser dialog with a VBA macro.

I'm trying to make a macro in VBA for Delmia. That macro need to open a file and I want to use a FileBrowserDialog to found the path of this file. I use this code that I found on a site but it was for an example using Excel. In excel this code work very well. The problem in Delmia is sometimes the dialog box do not appear and sometimes ...

Python: Copying files with special characters in path

Hi is there any possibility in Python 2.5 to copy files having special chars (Japanese chars, cyrillic letters) in their path? shutil.copy cannot handle this. here is some example code: import copy, os,shutil,sys fname=os.getenv("USERPROFILE")+"\\Desktop\\testfile.txt" print fname print "type of fname: "+str(type(fname)) fname0 = unico...