• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
  • Carey Brown
  • salvin francis
  • Claude Moore

Convert CSV to XML with PHP - When the data.csv is outside from the folder xml file is empty  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I moved the 'data.csv' to other place location it will not save the 'xml-import.xml' on my computer. The code only works if the CSV file 'data.csv' is in the same folder with convert.php (name of my PHP script) but if you moved the data.csv to different location, the 'xml-import.xml' are not save.

All I need is even if you move the data.csv files from different location the 'xml-import.xml' also save. Is that possible?

Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it is a file upload php script, the file name that is loaded would not be captured by $_POST['fname'] but would be hidden in $_FILES. Maybe it is after all not a file upload script, but a script allowing the client to give instruction to transform the csv to an xml. In any case, you said it works in some condition, I take your words for it.

If this is the line where you intend to set up for the case where the uploaded csv file is at some other (sub-directory), this is certainly not to work. You cannot even to take profit from the interpolation using double-quote as such without further twist for the purpose, as for $value.

Using it would be closer to a solution.
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!