• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Uploading

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I have a rather confusing question but please bear with me for a while.

You see i am trying to upload a file to a certain website called http://www.doubleZ.com.

I am using java's HttpUrlConnection class. Connecting to the website is okay and i am also getting its outputstream so i can upload the html page to the above site.

The thing is that the html page that i want to upload must be placed at this address http://www.doubleZ.com/roll/wt.html

Now my question is how to i create the folders to upload the html file to the address http://www.doubleZ.com/roll/wt.html
when the space that i have is just assigned with this address
http://www.doubleZ.com, so basically what i need is a way to create the folder named roll by using Java from the client side before i can upload the html file.

I hope i have not confused anyone

Any help is greatly appreciated

Thank You

Yours Sincerely

Richard West
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Servlets forum.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

so basically what i need is a way to create the folder named roll by using Java from the client side before i can upload the html file.



There is no Java on the client side (unless you count Applets).

Any Java that gets executed, either as a servlet or as a JSP, executes on the server.

As such, creating a file or folder on the server file system is a simple matter of Java file I/O for any area in which you have appropriate permissions.

Does this change your question at all?
[ July 27, 2006: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
P.S. If you need to be able to detect where your app is located on the server's file system, check out the ServletContext.getRealPath() method (which works fine unless you are running the app out of an unexpanded war file).
 
Richard West
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

Originally posted by Bear Bibeault:
As such, creating a file or folder on the server file system is a simple matter of Java file I/O for any area in which you have appropriate permissions.



For me assume that i have a html file on my disk called wt.html,
now what i am trying to do is create a HTTP uploader so that i can upload my wt.html file to the location at address http://www.doubleZ.com/roll/wt.html

No before i can upload to that location i need to create the directory roll on the server because all i have is this address http://www.doubleZ.com

Basically my question is that once i have authenticated myself into this address http://www.doubleZ.com how do i create the directory roll and create the file called wt.html on the server all from my side.

Is there a way this can be achieved?

Yours Sincerely

Richard West
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Richard West:
how do i create the directory roll and create the file called wt.html on the server all from my side.



What is "my side"? I'll assume you mean the client.

If so, you can't merely from HTML or Javascript. You'll either need to write a servlet to perform such actions on your behalf, or use an ftp client, or ssh into the server to create the folder from the command line.
 
Hey! Wanna see my flashlight? It looks like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic