Search the web
Sign In
New User? Sign Up
vmu-dev · The VMU Development list
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Re: [vmu] Web Upload Download Scripts?   Message List  
Reply | Forward Message #793 of 1156 |
> I'm looking to setup a database not unlike Booyaka, as it seems to be one
> of the only ones, and I would like to allow users to upload both from PC
> and DC (seaparate upload places I assume), and download from DC, and PC if
> possible. Does anyone know of any prewritten code which can be modified to
> upload these from a DC, as to upload them from a PC I guess that you just
> use the normal upload fields for anything.

> Is there any documentation or prewritten scripts out there which I can
use?

Here's what (I guess) you'd need

1) cgi script to handle the upload of .dci files from a PC - this should,
ideally save the .dci file, available for PC download, and also convert the
.dci into a .vmi/vms pair available for DC download

2) cgi script to handle the upload of data from a DC - this should convert
the data into .dci and .vmi/vms


If you're webserver supports compiled C programs as cgi, then you could
modify my vmux program to do the file conversion [source @
http://vmudev.dcemulation.com/ ] - that can convert .dci <-> .vmi/.vms




However, Loren Peace (creator of Booyaka, and the PSO image snapshot
converter) has already got working scripts for doing all of this. Perhaps
he might be willing to give you copies of his code. Are you still out there
Loren?

--

I just found an old post from Loren to a different list, so I'll reproduce
the info he game there:

--

> Oh yeah. Can anyone give me info on how the upload from the dreamcast
> browser works (for both dreamkey and planetweb)?

I can't comment about dreamkey, but here's the deal for planetweb:

first your web page needs a form like this

<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload.cgi">
<INPUT TYPE="VMFILE" NAME="VMUDATA" VALUE="None">
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>

The value you will get for the VMUDATA parameter is a line of attributes
followed by 2 line breaks and then the data in a shifted base64 encode.

The attributes look like this
filename=BOOYAKA.LOG &fs=1536&bl=3&tp=0&fl=0&of=0&tm=200006301201345
filename is obviouse, fs is file size in bytes, tm is the date on the
file in year(4)month(2)day(2)hour(2)minute(2)second(2)dayofweek(1) format,
bl is the number of VMU pages used; tp,fl,of have been zero for me so
far, so I'm not sure about them.

The rest of the upload is the base64 encoded file, first you must remap
the data sent to their proper base64 values, attached is a perl hash that
maps the letter used by PlanetWeb to the real one used in base64. (If
anyone doesn't know perl here's how to read the hash so you can use it,
left letter is what appears in the upload, it should be replaced by the
letter to the right of the arrow. ) Once you have remapped the data
simple base64 decode it and you have you uploaded save.

For any perl people I have also included a sample upload.cgi that will
upload files and place them in three parts in /tmp
<file-name>
<file-name>.ATTR
<file-name>.ORIG
where file-name is the filename attribute, .ORIG in the non-converted
base64 and .ATTR in the attribute line.

Let me know if I need to clarify anything better.


Loren Peace

--

[table.pl]

$main::UploadTable = {
'=' => '=',
'+' => 'y', # 0x2b => 0x79
'/' => '/', # 0x2f => 0x2f
'0' => '2', # 0x30 => 0x32
'1' => '7', # 0x31 => 0x37
'2' => '0', # 0x32 => 0x30
'3' => 'P', # 0x33 => 0x50
'4' => 'l', # 0x34 => 0x6c
'5' => 'g', # 0x35 => 0x67
'6' => 'M', # 0x36 => 0x4d
'7' => 'e', # 0x37 => 0x65
'8' => 'r', # 0x38 => 0x72
'9' => 'T', # 0x39 => 0x54
'A' => 'A', # 0x41 => 0x41
'B' => 'X', # 0x42 => 0x58
'C' => 's', # 0x43 => 0x73
'D' => 'Z', # 0x44 => 0x5a
'E' => 'I', # 0x45 => 0x49
'F' => 'x', # 0x46 => 0x78
'G' => '5', # 0x47 => 0x35
'H' => '+', # 0x48 => 0x2b
'I' => 'U', # 0x49 => 0x55
'J' => 'p', # 0x4a => 0x70
'K' => 'o', # 0x4b => 0x6f
'L' => 'D', # 0x4c => 0x44
'M' => 'k', # 0x4d => 0x6b
'N' => 'F', # 0x4e => 0x46
'O' => 'C', # 0x4f => 0x43
'P' => 'L', # 0x50 => 0x4c
'Q' => 'c', # 0x51 => 0x63
'R' => 'w', # 0x52 => 0x77
'S' => 'Q', # 0x53 => 0x51
'T' => 'J', # 0x54 => 0x4a
'U' => '4', # 0x55 => 0x34
'V' => '1', # 0x56 => 0x31
'W' => '9', # 0x57 => 0x39
'X' => 'W', # 0x58 => 0x57
'Y' => 'E', # 0x59 => 0x45
'Z' => 'B', # 0x5a => 0x42
'a' => 'i', # 0x61 => 0x69
'b' => 'h', # 0x62 => 0x68
'c' => 'N', # 0x63 => 0x4e
'd' => 'G', # 0x64 => 0x47
'e' => 'S', # 0x65 => 0x53
'f' => 'b', # 0x66 => 0x62
'g' => 'a', # 0x67 => 0x61
'h' => 'Y', # 0x68 => 0x59
'i' => 'O', # 0x69 => 0x4f
'j' => 'q', # 0x6a => 0x71
'k' => 'z', # 0x6b => 0x7a
'l' => 'f', # 0x6c => 0x66
'm' => 'K', # 0x6d => 0x4b
'n' => 'H', # 0x6e => 0x48
'o' => '6', # 0x6f => 0x36
'p' => 'n', # 0x70 => 0x6e
'q' => 'd', # 0x71 => 0x64
'r' => 'm', # 0x72 => 0x6d
's' => 'u', # 0x73 => 0x75
't' => 'j', # 0x74 => 0x6a
'u' => 't', # 0x75 => 0x74
'v' => '8', # 0x76 => 0x38
'w' => '3', # 0x77 => 0x33
'x' => 'v', # 0x78 => 0x76
'y' => 'V', # 0x79 => 0x56
'z' => 'R', # 0x7a => 0x52
};


[upload.cgi]
#!/usr/bin/perl -w

use strict;
use vars qw( $UploadTable );

use CGI::Fast;
use FileHandle;
use MIME::Base64;

{
local( $/ ) = undef;

my $table = new FileHandle;

open( $table, "</home/peace/www/table.pl" ) || die;
my $code = <$table>;
close( $table );

eval( $code );
die $@xxxx if $@;
}

while( my $query = new CGI::Fast ) {
if( $query->param( 'method' ) ) {
my $vmu = $query->param( 'VMUDATA' );

my @xxxx = split( /\n/, $vmu, 3 );
my $attr = $part[0];
$vmu = $part[2];

my $filetag = (split( /&/, $attr, 2 ))[0];
my $name = (split( /=/, $filetag, 2 ))[1];
$name = 'upload.vmu' if( $name eq '' );

my $file = new FileHandle;
if( open( $file, ">/tmp/$name" ) ) {
my @xxxx = split( //, $vmu );
for( my $i = 0; $i <= $#data; $i++ ) {
my $chr = $data[$i];
next if( $chr eq "\n" ) || ( $chr eq "\r" );
my $out = $UploadTable->{$chr};
$data[$i] = $UploadTable->{$data[$i]};
}
print $file decode_base64( join( '', @xxxx ) );
close( $file );
}

if( open( $file, ">/tmp/$name.ORIG" ) ) {
print $file $vmu;
close( $file );
}

if( open( $file, ">/tmp/$name.ATTR" ) ) {
print $file $attr;
close( $file );
}
}

print $query->header;
print $query->start_html;
print <<FORM;
<!--UPLOAD FORM-->
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload.cgi">
<INPUT TYPE="VMFILE" NAME="VMUDATA" VALUE="None">
<INPUT TYPE="SUBMIT" VALUE="Upload"><br>
</FORM>
FORM
print $query->end_html;

}



--
Richard Munn | Programmer | HooDoo Studio
richardm@... | http://www.codemasters.com
richard.munn@... | http://vmudev.dcemulation.com
(01926) 814132 Ext. 589 | Help me! I'm turning into a grapefruit!


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

**********************************************************************


Fri Apr 20, 2001 10:11 am

richard.munn@...
Send Email Send Email

> I'm looking to setup a database not unlike Booyaka, as it seems to be one
> of the only ones, and I would like to allow users to upload both from PC
> and DC (seaparate upload places I assume), and download from DC, and PC if
> possible. Does anyone know of any prewritten code which can be modified to
> upload these from a DC, as to upload them from a PC I guess that you just
> use the normal upload fields for anything.

> Is there any documentation or prewritten scripts out there which I can use?

Here's what (I guess) you'd need

1) cgi script to handle the upload of .dci files from a PC - this should, ideally save the .dci file, available for PC download, and also convert the .dci into a .vmi/vms pair available for DC download

2) cgi script to handle the upload of data from a DC - this should convert the data into .dci and .vmi/vms


If you're webserver supports compiled C programs as cgi, then you could modify my vmux program to do the file conversion [source @ http://vmudev.dcemulation.com/ ] - that can convert .dci <-> .vmi/.vms




However, Loren Peace (creator of Booyaka, and the PSO image snapshot converter) has already got working scripts for doing all of this.  Perhaps he might be willing to give you copies of his code.  Are you still out there Loren?

--

I just found an old post from Loren to a different list, so I'll reproduce the info he game there:

--

> Oh yeah.  Can anyone give me info on how the upload from the dreamcast
> browser works (for both dreamkey and planetweb)?

I can't comment about dreamkey, but here's the deal for planetweb:

first your web page needs a form like this

<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload.cgi">
<INPUT TYPE="VMFILE" NAME="VMUDATA" VALUE="None">
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>

The value you will get for the VMUDATA parameter is a line of attributes
followed by 2 line breaks and then the data in a shifted base64 encode.

The attributes look like this
filename=BOOYAKA.LOG &fs=1536&bl=3&tp=0&fl=0&of=0&tm=200006301201345
filename is obviouse, fs is file size in bytes, tm is the date on the
file in year(4)month(2)day(2)hour(2)minute(2)second(2)dayofweek(1) format,
bl is the number of VMU pages used; tp,fl,of have been zero for me so
far, so I'm not sure about them.

The rest of the upload is the base64 encoded file, first you must remap
the data sent to their proper base64 values, attached is a perl hash that
maps the letter used by PlanetWeb to the real one used in base64.  (If
anyone doesn't know perl here's how to read the hash so you can use it,
left letter is what appears in the upload, it should be replaced by the
letter to the right of the arrow. ) Once you have remapped the data
simple base64 decode it and you have you uploaded save.

For any perl people I have also included a sample upload.cgi that will
upload files and place them in three parts in /tmp
<file-name>
<file-name>.ATTR
<file-name>.ORIG
where file-name is the filename attribute, .ORIG in the non-converted
base64 and .ATTR in the attribute line.

Let me know if I need to clarify anything better.


Loren Peace

--

[table.pl]

$main::UploadTable = {
    '=' => '=',
    '+' => 'y',   # 0x2b => 0x79
    '/' => '/',   # 0x2f => 0x2f
    '0' => '2',   # 0x30 => 0x32
    '1' => '7',   # 0x31 => 0x37
    '2' => '0',   # 0x32 => 0x30
    '3' => 'P',   # 0x33 => 0x50
    '4' => 'l',   # 0x34 => 0x6c
    '5' => 'g',   # 0x35 => 0x67
    '6' => 'M',   # 0x36 => 0x4d
    '7' => 'e',   # 0x37 => 0x65
    '8' => 'r',   # 0x38 => 0x72
    '9' => 'T',   # 0x39 => 0x54
    'A' => 'A',   # 0x41 => 0x41
    'B' => 'X',   # 0x42 => 0x58
    'C' => 's',   # 0x43 => 0x73
    'D' => 'Z',   # 0x44 => 0x5a
    'E' => 'I',   # 0x45 => 0x49
    'F' => 'x',   # 0x46 => 0x78
    'G' => '5',   # 0x47 => 0x35
    'H' => '+',   # 0x48 => 0x2b
    'I' => 'U',   # 0x49 => 0x55
    'J' => 'p',   # 0x4a => 0x70
    'K' => 'o',   # 0x4b => 0x6f
    'L' => 'D',   # 0x4c => 0x44
    'M' => 'k',   # 0x4d => 0x6b
    'N' => 'F',   # 0x4e => 0x46
    'O' => 'C',   # 0x4f => 0x43
    'P' => 'L',   # 0x50 => 0x4c
    'Q' => 'c',   # 0x51 => 0x63
    'R' => 'w',   # 0x52 => 0x77
    'S' => 'Q',   # 0x53 => 0x51
    'T' => 'J',   # 0x54 => 0x4a
    'U' => '4',   # 0x55 => 0x34
    'V' => '1',   # 0x56 => 0x31
    'W' => '9',   # 0x57 => 0x39
    'X' => 'W',   # 0x58 => 0x57
    'Y' => 'E',   # 0x59 => 0x45
    'Z' => 'B',   # 0x5a => 0x42
    'a' => 'i',   # 0x61 => 0x69
    'b' => 'h',   # 0x62 => 0x68
    'c' => 'N',   # 0x63 => 0x4e
    'd' => 'G',   # 0x64 => 0x47
    'e' => 'S',   # 0x65 => 0x53
    'f' => 'b',   # 0x66 => 0x62
    'g' => 'a',   # 0x67 => 0x61
    'h' => 'Y',   # 0x68 => 0x59
    'i' => 'O',   # 0x69 => 0x4f
    'j' => 'q',   # 0x6a => 0x71
    'k' => 'z',   # 0x6b => 0x7a
    'l' => 'f',   # 0x6c => 0x66
    'm' => 'K',   # 0x6d => 0x4b
    'n' => 'H',   # 0x6e => 0x48
    'o' => '6',   # 0x6f => 0x36
    'p' => 'n',   # 0x70 => 0x6e
    'q' => 'd',   # 0x71 => 0x64
    'r' => 'm',   # 0x72 => 0x6d
    's' => 'u',   # 0x73 => 0x75
    't' => 'j',   # 0x74 => 0x6a
    'u' => 't',   # 0x75 => 0x74
    'v' => '8',   # 0x76 => 0x38
    'w' => '3',   # 0x77 => 0x33
    'x' => 'v',   # 0x78 => 0x76
    'y' => 'V',   # 0x79 => 0x56
    'z' => 'R',   # 0x7a => 0x52
};


[upload.cgi]
#!/usr/bin/perl -w

use strict;
use vars qw( $UploadTable );

use CGI::Fast;
use FileHandle;
use MIME::Base64;

{
        local( $/ ) = undef;
       
        my $table = new FileHandle;

        open( $table, "</home/peace/www/table.pl" ) || die;
        my $code = <$table>;
        close( $table );

        eval( $code );
        die $@xxxx if $@;
}

while( my $query = new CGI::Fast ) {
        if( $query->param( 'method' ) ) {
                my $vmu = $query->param( 'VMUDATA' );
               
                my @xxxx = split( /\n/, $vmu, 3 );
                my $attr = $part[0];
                $vmu = $part[2];
               
                my $filetag = (split( /&/, $attr, 2 ))[0];
                my $name = (split( /=/, $filetag, 2 ))[1];
                $name = 'upload.vmu' if( $name eq '' );
               
                my $file = new FileHandle;
                if( open( $file, ">/tmp/$name" ) ) {
                        my @xxxx = split( //, $vmu );
                        for( my $i = 0; $i <= $#data; $i++ ) {
                                my $chr = $data[$i];
                                next if( $chr eq "\n" ) || ( $chr eq "\r" );
                                my $out = $UploadTable->{$chr};
                                $data[$i] = $UploadTable->{$data[$i]};
                        }
                        print $file decode_base64( join( '', @xxxx ) );
                        close( $file );
                }
               
                if( open( $file, ">/tmp/$name.ORIG" ) ) {
                        print $file $vmu;
                        close( $file );
                }
               
                if( open( $file, ">/tmp/$name.ATTR" ) ) {
                        print $file $attr;
                        close( $file );
                }
        }
       
        print $query->header;
        print $query->start_html;
        print <<FORM;
                <!--UPLOAD FORM-->
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload.cgi">
<INPUT TYPE="VMFILE" NAME="VMUDATA" VALUE="None">
<INPUT TYPE="SUBMIT" VALUE="Upload"><br>
</FORM>
FORM
        print $query->end_html;

}



--
Richard Munn | Programmer | HooDoo Studio
 richardm@... | http://www.codemasters.com
 richard.munn@... | http://vmudev.dcemulation.com
  (01926) 814132 Ext. 589 | Help me! I'm turning into a grapefruit!



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

**********************************************************************


Forward
Message #793 of 1156 |
Expand Messages Author Sort by Date

... use? Here's what (I guess) you'd need 1) cgi script to handle the upload of .dci files from a PC - this should, ideally save the .dci file, available for...
Richard Munn
richard.munn@...
Send Email
Apr 20, 2001
10:11 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help