Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3280544
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:42:59+00:00 2026-05-17T19:42:59+00:00

String date = new java.text.SimpleDateFormat(MM-dd-yyyy).format(new java.util.date()); upload.uploadfile(192.168.0.210, muruganp, vm4snk, /home/media/Desktop/FTP Upload/+date+_RB.zip, /fileserver/filesbackup/Emac/+date+_RB.zip); uploadfile is

  • 0
String date = new java.text.SimpleDateFormat("MM-dd-yyyy").format(new java.util.date());
upload.uploadfile("192.168.0.210", "muruganp", "vm4snk", "/home/media/Desktop/FTP Upload/+date+"_RB.zip"", "/fileserver/filesbackup/Emac/+date+"_RB.zip"");

uploadfile is a function which uploads the file 10-20-2010_RB.zip to the server location.

But since I do have the string “date” in my path, few errors like illegal start of expression occurs.

If I try the same as below, the program works fine.

upload.uploadfile("192.168.0.210", "muruganp", "vm4snk", "/home/media/Desktop/FTP Upload/20-10-2010_RB.zip", "/fileserver/filesbackup/Emac/20-10-2010_RB.zip");

For some reasons, I am in a compulsion to insert the string in the file path. How can I attain the end result ? Kindly advise.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T19:43:00+00:00Added an answer on May 17, 2026 at 7:43 pm

    You’re getting syntax errors because you don’t have quote marks correct in the string concatenation. You need to change

    upload.uploadfile("192.168.0.210", "muruganp", "vm4snk",
        "/home/media/Desktop/FTP Upload/+date+"_RB.zip"",
        "/fileserver/filesbackup/Emac/+date+"_RB.zip"");
    

    to

    upload.uploadfile("192.168.0.210", "muruganp", "vm4snk",
        "/home/media/Desktop/FTP Upload/"+date+"_RB.zip",
        "/fileserver/filesbackup/Emac/"+date+"_RB.zip");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using java.text.SimpleDateFormat to parse string representations of date/time values inside an XML document.
Can't understand why the following takes place: String date = 06-04-2007 07:05; SimpleDateFormat fmt
I'm a little blockheaded right now… I have a date string in european format
I have a string containing a date, and another string containing the date format
I have to use a custom date format in Java. It contains microseconds although
I am having following function public static Date parseDate(String date, String format) throws ParseException
this problem is killing me, here is my code import java.text.ParseException; import java.text.SimpleDateFormat; import
here is the code String DateOfBirth[]=strDOB.split(/); Date dateOfBirth = new Date(); dateOfBirth.setYear(Integer.parseInt(DateOfBirth[2].trim())); dateOfBirth.setMonth(Integer.parseInt(DateOfBirth[1].trim())); dateOfBirth.setDate(Integer.parseInt(DateOfBirth[0].trim()));
Hi i am trying to parse a string into a java.sql.date Here is what
I've got this date time string: post[date] = 2007-07-18 10:03:19 I'd like to extract

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.