CGI, stdin, image handling

Mark Smith mark at maseurope.net
Wed Jan 23 17:05:22 EST 2008


Richard, please disregard the base64 thing - not sure what I was  
thinking!

I'm wondering how these PHP scripts get the jpegs ok, but the rev cgi  
doesn't. Are you sure that your cgi is parsing the posted data  
correctly?

Best,

Mark

On 23 Jan 2008, at 21:28, Richard Miller wrote:

> Mark,
>
> I'm not quite sure what you're suggesting. I have no control of the  
> files before they are uploaded through a browser. These files could  
> come from any user.  Are you suggesting to take the data that comes  
> in through the Rev CGI and use base64decode on it before saving it?
>
> The other route I've been pursuing is to use a PHP-based file  
> upload script to bring the files into the server. There are dozens  
> of those scripts and they all work fine. The problem I have is that  
> these scripts simply upload a file to a given directory and store  
> it, but provide no means to identify the source of the file. In my  
> case, for each JPEG that comes in, those images are associated with  
> specific records in my database. I haven't figured out how to  
> identify which record any given JPEG is associated with. Seems that  
> none of these PHP scripts provide for a way to capture additional  
> information on the uploaded images. They just store file under its  
> original file name. This process would be much easier if I could  
> get the Rev CGI to pull in the image files.
>
> Thanks.
> Richard
>
>
> On Jan 23, 2008, at 4:10 PM, Mark Smith wrote:
>
>> Richard, have you tried base64encoding the data before posting?
>>
>> best,
>>
>> Mark
>>
>> On 23 Jan 2008, at 20:59, Richard Miller wrote:
>>
>>> I'm trying to use the CGI POST method and stdin to grab a JPEG  
>>> file through a browser. The file comes in and I can save it (as a  
>>> binary file), but the file data is a bit corrupted...  
>>> particularly at the beginning and end. I can delete those  
>>> sections, but I'm still noticing some extra characters throughout  
>>> the file. I don't know why this is and if it can be fixed, but  
>>> without that, the routine simply doesn't work. Is there any hope  
>>> for this method of capturing image files from a user via a browser?
>>>
>>> Thanks.
>>> Richard Miller
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your  
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list