You are not logged in.

donkjam

Beginner

  • "donkjam" started this thread

Posts: 1

Date of registration: Apr 16th 2012

  • Send private message

1

Monday, April 16th 2012, 1:34am

FTP help?

Hello i am looking for some help with amn FTP function...I am wanting to upload an image to a web server, i have tried VB code etc but it wont get recognised!

Any help is great thanks

JasonS

Trainee

  • "JasonS" is male

Posts: 65

Date of registration: Feb 17th 2010

  • Send private message

2

Thursday, April 26th 2012, 5:02am

Greetings donkjam,

I have here a VB6 sample ported to a Jabaco applet, made to upload files using post via HTTP, but not FTP. Still, I find it useful. The text fields are pre-filled out in this sample, but you need to modify them (especially mime type unless it is a plaintext file), then click select your file & upload. This applet could use some basic code to auto generate the mime type based on extension.

The default php url in this sample, that allows you to test uploading a file, is the original
url provided with the original VB6 sample code and it still works as of right
now. You can change this to your own easily.

If I can find some more time soon, I will make an FTP uploader sample applet. I have attached the HTTP upload sample for now.

Regards,
Jason

httpuploader.zip

JasonS

Trainee

  • "JasonS" is male

Posts: 65

Date of registration: Feb 17th 2010

  • Send private message

3

Friday, November 2nd 2012, 11:49pm

Revised version of sample

Greetings,

I have here for whoever needs it a sample applet that allows you to upload files to a web server with PHP enabled. I have provided the required htdocs to run it. Simply extract the attached zip to your JabacoProjects directory, open the project, (edit accordingly if needed), and compile the jar file somewhere. Next copy only the compiled jar file to the upload folder you copied into your real htdocs directory on apache or whatever the root is on your other type of web server (IIS, etc.). You also will need post_dump.php (included in the zip file) in the root of your htdocs directory for this demo to work.

Now navigate to http://yoursite.c0m/upload/ ... and index.html (also supplied) should load the java applet.

I have used this for many things when I require to upload data to my server as a binary file. I just copy this projects code into a sectioned off part of my master projects code, copy the stuff from the form and paste it onto a part of your master projects form at a spot that isnt visible, and you can make it all hidden (.visible = false) if you want too after debugging your app and making sure it is uploading files right.

I also should mention, you may want to read up about post_dump.php and modify it to suit your needs and security practices, etc.

And finally, the mime-type (which you can change the default .text value of the its textbox on the form), must match the mime-type of file you are or are going to be uploading via HTTP POST.

Any questions, Ill do my best to answer.

Regards,
Jason
JasonS has attached the following file:

Rate this thread
WoltLab Burning Board