473,395 Members | 1,783 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

get filepath for FTP upload

46
Hi Guys,

Can anyone advise on how to get get a file's filepath via a form?

I am working on using a form to allow a user to select a file, then the
app uses FTP to transfer the file to the server.

As part of ftp you must supply it the location/filepath of your file.

I am using the form element 'file_field' - which does
return a filepath - but not really!

eg., say my file lived in:
/my/files/burger.jpg

but the information in the 'file_field' is stored as:

--- !ruby/object:ActionController::UploadedStringIO
content_type: image/jpeg
original_filename: burger.jpg
original_path: burger.jpg


Any help would be appreciated!

Cheers

Adam
Jun 25 '08 #1
1 3821
improvcornartist
303 Expert 100+
Since the uploaded file is a StringIO, I'm not sure how to get the full path. But since it is StringIO, you can read the file data and save it as a new file.
Jun 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Todd Richardson | last post by:
I have written a web form which downloads files to the client automatically. After the download completes, I would like to delete the file that was downloaded. I can't tell how to wait until the...
9
by: mjakowlew | last post by:
Hi, I'm trying to use some string manipulation from a file's path. filepath='c:\documents\web\zope\file.ext' I need to extract everthing after the last '\' and save it. I've looked around...
0
by: darrel | last post by:
when I use 'request.filepage' I get the URL that is shown in the address bar of the browser. The catch is that it will not return the name of the page itself, it if isn't part of the URL (namly...
5
by: starritt | last post by:
I have to create a view where the filename is seperated from the path to the file. Examples of the data include: m:\images\big\myimg.jpg m:\images\medium\myimg.jpg...
3
by: Darrel | last post by:
using Request.FilePath will return the entire file path: directory/directory/myfile.aspx Is there a built function in ASP.net to grab just the filename (myfile.aspx) or do I need to write...
1
by: Cindy H | last post by:
Hi I used the code below to automatically open a pdf file when the user clicks on a menu option. It works great on local machine, but when I uploaded it to hosting site and then tried it, I...
12
by: snow | last post by:
Hi All, I noticed if file path has a white space, for example "C:\my document \test.txt", the function File.Exists(filePath) always return false in release mode. How could I make this function...
10
by: ganeshp | last post by:
Below given is the code to check if a file exists. This code works on Windows but on Linux it fails even when the file exists. Please let me know if you have a solution or a work around for this....
2
by: AdrianJ1980 | last post by:
Hi all, Apologies if this has been discussed before, but my numerous searches (google and otherwise) have come up with nothing. What i need to do is open a word document (from Access 2003),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.