The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Question regarding fwrite(), filesize(), binary stream
I have the stream of the binary data. I need to use some file
associated function with it. For example filesize(), imagesize() etc. At the moment, I write this data stream into a tmp file fwrite('/tmp/tempfile', 'x+'), do the file functions, then unlink() it. It surely is not an elegant way to do, let along a good portability way. Is there a way to create a file in the memory from the data stream? or even use file functions without first write the stream into a file? Thanks. |
#2
|
||||
|
||||
To get information about a file, without saving it to a permanent directory:
PHP Code:
PHP Code:
|
#3
|
|||
|
|||
Quote:
Unfortunately this data stream does not come from a uploaded file. It is actually from decoded mime/uuencoded message. May be I can find the temp directory enviroment within the script. |
#4
|
|||
|
|||
I have found you can actually write to $_FILES.
Also to find out the temp direcotory. The following code should help: if (!$tmp_dir = get_cfg_var('upload_tmp_dir')) { $tmp_dir = dirname(tempnam('', '')); } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|