Setting a Limit to the Maximum Size of an Upload

2005-10-24 Thread Joey C.
Hello, I'm designing a small "briefcase" program that will allow me to quickly upload, download, and delete files in a briefcase. The only real things that I have left to do are to design a method for checking if the file exists, preventing it from overwriting files from other directories, and set

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-24 Thread Joey C.
Here is a basic overview of the variables included there. params = cgi.FieldStorage() I accidentally made a mistake when typing what the "thefile" variable is. thefile = params["upfile"].file "upfile" is the CGI field that contains the file that I'm uploading. As you can see, the if statement just

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Joey C.
I'm afraid on my interpreter, this works. >>> if os.path.getsize("C:\\Documents and Settings\\Joey\\Desktop\\file.txt") >>> <= 1000: >>> print "<= 1000." <= 1000. No problems there, as you can see. -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-25 Thread Joey C.
Oh, I'm sorry, I didn't understand what you meant at first. Then I read your reply over again and noticed that you said that the problem lied in os.path.getsize() when I tried to run it on the contents of an open file. I'll try the method you outlined now. -- http://mail.python.org/mailman/listi

Re: Setting a Limit to the Maximum Size of an Upload

2005-10-27 Thread Joey C.
Yes, I see that now. I tried your method and it seemed to work fine until I tried printing the filesize out. def checkfilesize(thefile): # Check the Size of the File global filesize thefile.seek(0,2) filesize = thefile.tell() thefile.seek(0) print filesize print conf["upmax"]

Using win32ui.CreateFileDialog() to get the name of a file.

2005-11-19 Thread Joey C.
Hello. I'm writing a program that creates a series of batch operations to convert movies to be used on iPodLinux. The programs that do the encoding and conversions are seperate from mine and all mine does is use os.system() to call the program. However, it needs to get an input file and an output

Re: Using win32ui.CreateFileDialog() to get the name of a file.

2005-11-19 Thread Joey C.
Okay, thank you. This worked very well. -- http://mail.python.org/mailman/listinfo/python-list

Re: Super Newbie Question

2005-04-05 Thread Joey C.
To reply to many of your messages (I'm using Google right now due to lack of a better newsreader at the moment), the issue with the temporary file is that when I write something new to it, if the old contents of the file was larger, not all of it will be overwritten. So, the truncate() method will

Re: Best editor?

2005-04-06 Thread Joey C.
When I'm using Windows, I have found the Syn TextEditor (http://syn.sourceforge.net) to be quite useful. It has basic syntax highlighting, about enough for me and is quite compatible with FTP and such. It supports Python pretty well. Its user interface is quite easy yet pretty powerful. All in

Stupid Newbie Question Concerning CGI and Reading Forward Slashes

2005-05-31 Thread Joey C.
enough. Thanks for all of your help and I'm sorry if this is a question that has been asked 15 million times. Joey C. -- http://mail.python.org/mailman/listinfo/python-list

Re: Stupid Newbie Question Concerning CGI and Reading Forward Slashes

2005-05-31 Thread Joey C.
Steve Holden wrote: > It's not a common question, but it's relatively easily answered. You are > splitting everything but the filename off with os.path.split and then > complaining about the result! Once you stop doing that your problem is > solved. Thus, it's a stupid newbie question. Thanks a l