file

file upload error

Hello everyone, Here is my code at both client side and server side. My code is simple, just upload a file to an ASP.Net web site. My client code throws exception when it works on Vista (x64, Enterprise, SP1), but works fine on Windows Server 2003. Any ideas? 10.10.12.162 is my server address. [Code] Client: static void Main(str...

How to determine the size of an attached file from a IMAP message

Im writing a IMAP mail application running on J2ME. It's my senior project. First, I would like to know that are there any IMAP messages to get the body of message only, not include an attachement? When I send the message to IMAP Server like.. . fetch 20 body[text] The IMAP Server will response like <--BODY PART--> ---MOQ1233897306...

[Java] How to open user system preffered editor for given file?

Hi, I'm trying to figure out how to open system preferred editor for given file. Say, we have a file manager, written in Java. User goes to folder and see list of files. And, for example, there are file "Icon.jpg". User double clicks on the filename and file opens in system's preferred editor (i.e. Gimp). The main issue is - how to do ...

How To Store Files In An EXE C#

Alright, so I'm working on programming my own installer in C#, and what I'd like to do is something along the lines of put the files in the .exe, so I can do File.Copy(file, filedir); Or, if this isn't possible, is there another way of doing what I am attempting to do? Thank you in advance. ~Seth ...

How do I search for multiple file types on Google Search Appliance

I want to search for multiple file types at once. For example, when I want to search for ".htm" files, I add "filetype:htm" to the query and that works fine. Similarly, "filetype:html" also works. However, how can I specify a query parameter that returns all htm AND html files? ...

C# file Printing as per PDF or Excel or Word or Note pad file Template

i want to print from C# as per PDF or Excel or Word or Note pad template ...

File Vs Database

I'm going to implement an Access Control List for each individual user so they can assign access to their own resources so they can hide stuff, for example, from their mothers, but show their friends. Now storing ACL in a database seems like it can get pretty insane when each user is also a group, which can have many sub groups. So I'm ...

ASP.NET File uploading-dynamic file names

I have a web page where i have an ASP.NET file upload control to upload files from client machine to Server.Now i want to do the uploading n number of times.Ex : I want to upload 100 files from my local pc to server.The 100 file names i can read from an excel file in my program.But is there any way to assign this file to the file upload...

problems once uploaded to server

This all works fine in MAMP but i've uploaded and now the problems start. heres an image of the code for the link and a grab of the result First image Second image any ideas? ...

Cannot get file data from the clipboard using Flex

Given: A Flex TileList with the following event: <mx:nativeDragDrop> <![CDATA[ if(event.clipboard.hasFormat(ClipboardFormats.FILE_LIST_FORMAT)) { var files:Array = event.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT) as Array; for each(var file:File in files) { // file.data is null here! } ...

Printing to LPT1 in C#

How do you print directly to a dot matrix printer in C# using file LPT1. I did it on C++ with fopen, but I don't know how to do it in c#. thank you very much ...

How to avoid tripping over UTF-8 BOM when reading files

I'm consuming a data feed that has recently added a Unicode BOM header (U+FEFF), and my rake task is now messed up by it. I can skip the first 3 bytes with file.gets[3..-1] but is there a more elegant way to read files in Ruby which can handle this correctly, whether a BOM is present or not? ...

Best method for reading newline delimited files in Python and discarding the newlines?

I am trying to determine the best way to handle getting rid of newlines when reading in newline delimited files in Python. What I've come up with is the following code, include throwaway code to test. import os def getfile(filename,results): f = open(filename) filecontents = f.readlines() for line in filecontents: foo = ...

How can i get a BitmapData object out of a File object from a local jpeg file in AIR?

So I am trying to create an image gallery. My AIR application accepts files that are dragged and dropped onto a TileList component. I am using the images as icons but the problem is that they take a long time to load so i want to compress the file data first (I have that part done) The problem is that I can't figure out how to open the f...

Check whether a PDF-File is valid (Python)

I get a File via a HTTP-Upload and need to be sure its a pdf-file. Programing Language is Python, but this should not matter. I thought of the following solutions: Check if the first bytes of the string are "%PDF". This is not a good check but prevents the use from uploading other files accidentally. Try the libmagic (the "file" comma...

Get sector location of a file

Based on a file name, or a file handle, is there a Win-API method of determining what physical sector the file starts on? ...

python MySQL module class file name

I am confused how directory name, file name and class name all work together. This is what I have at the moment app.py database/ client.py staff.py order.py inside client.py I have a single class called client. This class acts as the database model (MVC), the same with my other files (staff.py has a class called st...

Detect file handle leaks in python?

My program appears to be leaking file handles, how can I find out where? - My program uses file handles in a few different places - output from child processes, call ctypes api (imagemagick) opens files, and they are copied. It crashes in shutil.copyfile, but I'm pretty sure this is not the place it is leaking Traceback (most recent c...

In Java, how do I parse XML as a String instead of a file?

I have the following code: DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlFile); How can I get it to parse XML contained within a String instead of a file? ...

unfolding a file on linux

I have a huge textfile, approx 400.000 lines 80 charachters wide on liux. Need to "unfold" the file, merging four lines into one ending up having 1/4 of the lines, each line 80*4 charachters long. any suggestions? ...