file

overriding upload_max_filesize

Hello, I am trying to override my upload_max_filesize in php but I still get the value which is in my php.ini file which is 2 mb. ini_set('upload_max_filesize','30M'); ini_set('post_max_size','30M'); echo("<br>".ini_get('upload_max_filesize')."<br>"); ...

Regex to detect urls that where the last 'segment' contains a period

I need a regular expression that detects if a given string is a url to a [potential] file ie /file.pdf http://www.whatever.com/file.docx ../file.longfileextension Thanks guys ...

File creation fails in standard account (Vista)

I have created C# application, which creates a image file on Desktop. It works fine on XP and Vista (admin account) but it fails to create image file on Desktop in Vista (standard account). Whether i have to include manifest file to the application to work properly? If i add manifest, will it work on XP without any problems? Sorry if i...

How to remove duplicate words from a plain text file using linux command

I have a plain text file with words, which are separated by comma, for example: word1, word2, word3, word2, word4, word5, word 3, word6, word7, word3 i want to delete the duplicates and to become: word1, word2, word3, word4, word5, word6, word7 Any Ideas? I think, egrep can help me, but i'm not sure, how to use it exactly.... ...

SSH Connection with Python 3.0

How can I make an SSH connection in Python 3.0? I want to save a file on a remote computer where I have password-less SSH set up. ...

How to buffer stdout in memory and write it from a dedicated thread

I have a C application with many worker threads. It is essential that these do not block so where the worker threads need to write to a file on disk, I have them write to a circular buffer in memory, and then have a dedicated thread for writing that buffer to disk. The worker threads do not block any more. The dedicated thread can saf...

Open files using VisualBasicScript (.vbs)

Hello, i want to open a file with VisualBasicScript (.vbs) How could i do this? The file is 'file.bat' and it's located in the same dir as the .vbs. It should RUN it! ...

Python's file.read() on Ubuntu

Python's file.read() function won't read anything. It always returns '' no matter what's inside the file. What can it be? I know it must be something straightforward, but I can't figure it out. UPD: I tried with 'r' and 'w+' modes. UPD: The code was: >>> file = open('helloworld', 'w+') >>> file.read() '' Solution: It jus...

Printing data from dynamically added combo boxes?

Hi there, I have gotten the code to work so that when I press the button, "Add More", it adds more combo boxes to the form with the names dayBox1, dayBox2, and so on. This is the code for that: private void addMoreBtn_Click(object sender, EventArgs e) { //Keep track of how many dayBoxes we have howMany++; ...

How do I join two paths in C#?

I searched StackOverflow for the title of this question, but I didn't find anything ... so, how do I join two file paths ? ...

jsp tag files and log4j

Whats the best way to add log4j logging to a jsp tag file.. I've got as far as importing the logger class.. <%@ tag import="org.apache.log4j.Logger" %> But having a bit of trouble initialising the logger object. <% Logger log = Logger.getLogger("xxx.xxx.xxx.xx"); %> Because I'm using a tag file with a .tag extension, what do I put ...

Discrepancy between call to statvfs and df command

When I use the statvfs command on a Linux machine to get the available free space on a mounted file system, the number I get is slightly different than what is reported by df. Is there some reason for this? For example, one on machine I have with a 500G hard drive, I get the following output from df: # df --block-size=1 --no-sync File...

MATLAB FREAD/FWRITE

I want to change the value of a couple of bytes in a large binary file using matlab's fwrite command. What I am trying to do is open the file using fopen(filename,'r+',precision) then read down the file using fread(fid,NUM,'int32') (this all works). Once I get to the file position where I want to write (overwrite) the values of the nex...

Uploading files through a HTTP POST in C++

I'm trying to send a file and other POST variables to a PHP script on my server. There are no good resources on Google and the code samples I've found don't work. Preferably without using cURL. ...

How to Get a image file type using GDI+ in c++?

Some jpeg image is stored with .bmp ext. I want to use gdi+ to get the real type of the image file, how can I do this? Many thanks! ...

Check to see if excel file is available before opening or starting it

Ok so here's the problem, i use a connection with using(connection.... blah blah) and then after my using block is over I want to start the excel aplication like this: System.Diagnostics.Process.Start(excelFile); This works... sometimes, other times my computer runs too quick and before the file is fully close, or the connection is full...

Can I compile anonymous or inner classes into a single java .class file?

I am writing a Java class that parses log files. The compiled .class file needs to be loaded into a 3rd party monitoring platform (eG) for deployment and invocation. Unfortunately, the 3rd party platform only allows me to upload a single .class file. My current implementation has a function to find the 'latest' file in a folder that...

html form enctype

In HTML forms containg file uploads, enctype="multipart/form-data" attribute has to be set. This much I know. But why? What exactly does it change? How does it differ from application/x-www-form-urlencoded? ...

Adobe flex maximum size of uploaded file

Is there a maximum size limit for files being uploaded in Adobe Flex? I am testing it on localhost and can't upload a file of roughly 300MB. Even though I receive the complete event, after I upload the file.... I was able to upload a file of roughly 10MB. I am using PHP on the server side. ...

Continue an interrupted dowload on iPhone

Hello ! I use NSURLConnection to download large files from the web on iPhone. I use the "didReceiveData" method to append data to a file in the Documents folder. It works fine. If the download is interrupted (for instance, because the user pressed the "home" button), I would like to be able to continue to download the next time the use...