Spanish Takephoto subir por ftp

dgmegias

Member
Licensed User
Un saludo a todos

Hace 2 años hice esta app y me funcionaba perfectamente, hace poco puede recuperarla y al volver a ejecutarla siempre me indica que no puede subir la foto, como si no la hiciera.

Dejo el proyecto completo por si alguien pudiese ayudarme y decirme porque el metodo de captura de imagen no hace ninguna foto y como solventarlo.

Gracias

PD. El servidor ftp está revisado, desde el mismo dispositivo movil puedo enviar un fichero o bajarlo
 

Attachments

  • PhotoFTP.zip
    28.7 KB · Views: 246

dgmegias

Member
Licensed User
Gracias por interesarte, este es el error que me indica

** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
(RuntimeException) java.lang.RuntimeException: Error uploading file.
553 Could not create file.
 

josejad

Expert
Licensed User
Longtime User
Revisa entonces los permisos en tu servidor FTP.
Yo he puesto los datos del mío, y ha funcionado correctamente

B4X:
** Service (starter) Destroy (ignored)**
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
** Activity (main) Resume **
/storage/emulated/0/Android/data/b4a.example/files / 1492019_1418.jpeg
Uploaded 1KB
Uploaded 2KB
Uploaded 3KB
Uploaded 4KB
Uploaded 5KB
Uploaded 6KB
Uploaded 7KB
Uploaded 8KB
Uploaded 9KB
Uploaded 10KB
Uploaded 11KB
Uploaded 12KB
...

Eso sí, he modificado la línea de subida de
B4X:
FTP.UploadFile(File.DirDefaultExternal, fecha, False, "/home/pi/Documents/")

a

B4X:
FTP.UploadFile(File.DirDefaultExternal, fecha, False, "/home/pi/Documents/" & fecha)
 

dgmegias

Member
Licensed User
PERFECTO

El error estaba en que no indicaba el nombre del fichero que era fecha

estoy con la version 6.50 y este es mi manifest.

'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="23"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

AddManifestText(
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />
)

Si cambio algun valor del SDK la app me da este error camera is not available

en el log me indica esto

(FileUriExposedException) android.os.FileUriExposedException: file:///storage/emulated/0/Android/data/b4a.example/files/tempimage.jpg exposed beyond app through ClipData.Item.getUri()
 

josejad

Expert
Licensed User
Longtime User
Hola:

Deberías abrir un nuevo post para un nuevo problema.
Como vi que en tu app ya aplicaste los runtime permissions para acceder a los archivos, solicita antes de hacer la foto permiso para usar la cámara.

Saludos
 
Top